From 54ad37081dbaa4c5b669b9c1dbb46cb5f665b6d8 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Sun, 31 Mar 2019 20:22:46 +0300 Subject: [PATCH] (4ec4fe293) Fixed nullref exception when attempting to speak as a monster in single player. Closes #1374 --- .../BarotraumaClient/Source/GameSession/CrewManager.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Barotrauma/BarotraumaClient/Source/GameSession/CrewManager.cs b/Barotrauma/BarotraumaClient/Source/GameSession/CrewManager.cs index d625ef340..0762fbd00 100644 --- a/Barotrauma/BarotraumaClient/Source/GameSession/CrewManager.cs +++ b/Barotrauma/BarotraumaClient/Source/GameSession/CrewManager.cs @@ -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];