Fix crash on invalid command from UI

This commit is contained in:
John Gross
2019-04-19 11:23:04 -07:00
parent 2fd8c17525
commit 93bb11c135

View File

@@ -178,6 +178,12 @@ namespace Torch.Server
_server.Invoke(() =>
{
var responses = commands.HandleCommandFromServer(text);
if (responses == null)
{
InsertMessage(new TorchChatMessage(TorchBase.Instance.Config.ChatName, "Invalid command.", TorchBase.Instance.Config.ChatColor));
return;
}
foreach (var response in responses)
InsertMessage(response);
});