Fixed crash when backspace was pressed in an empty chat message field

This commit is contained in:
bilgorajskim 2015-09-23 12:23:08 +02:00
parent 9c10e8f769
commit b9741676a6

View File

@ -187,7 +187,7 @@ namespace TrueCraft.Client.Interface
if (HasFocus)
{
if (e.Key == Keys.Back)
Input = Input.Substring(0, Input.Length - 1);
Input = Input.Length > 0 ? Input.Substring(0, Input.Length - 1) : Input;
else
{
var shift = (Keyboard.State.IsKeyDown(Keys.LeftShift) || Keyboard.State.IsKeyDown(Keys.RightShift));