Fix pressing text with empty chat input crashing. (Thanks nyxzimus)

This commit is contained in:
UnknownShadow200 2016-01-06 15:26:54 +11:00
parent 316ce10567
commit b8c5895665
2 changed files with 3 additions and 1 deletions

View file

@ -110,6 +110,7 @@ namespace ClassicalSharp {
chatInputText.Clear();
if( typingLogPos >= game.Chat.InputLog.Count ) {
typingLogPos = game.Chat.InputLog.Count;
if( originalText != null )
chatInputText.Append( 0, originalText );
} else {
chatInputText.Append( 0, game.Chat.InputLog[typingLogPos] );

View file

@ -195,6 +195,7 @@ namespace ClassicalSharp {
caretPos = -1;
Dispose();
Height = defaultHeight;
originalText = null;
altText.SetActive( false );
}