(4ec4fe293) Fixed nullref exception when attempting to speak as a monster in single player. Closes #1374

This commit is contained in:
Joonas Rikkonen
2019-03-31 20:22:46 +03:00
parent 1d766ef349
commit 54ad37081d

View File

@@ -130,7 +130,12 @@ namespace Barotrauma
{
OnEnterMessage = (textbox, text) =>
{
if (Character.Controlled == null) { return true; }
if (Character.Controlled?.Info == null)
{
textbox.Deselect();
textbox.Text = "";
return true;
}
textbox.TextColor = ChatMessage.MessageColor[(int)ChatMessageType.Default];