Fix crash on invalid command from UI
This commit is contained in:
@@ -178,6 +178,12 @@ namespace Torch.Server
|
|||||||
_server.Invoke(() =>
|
_server.Invoke(() =>
|
||||||
{
|
{
|
||||||
var responses = commands.HandleCommandFromServer(text);
|
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)
|
foreach (var response in responses)
|
||||||
InsertMessage(response);
|
InsertMessage(response);
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user