@@ -5,4 +5,5 @@ Changelog
------
*DD MMM YYYY*
+* tools: fixed a crash when entering empty commands in the console
* tools: fixed an issue that prevented the data compiler from restoring and saving its state when launched by the level editor
@@ -65,6 +65,9 @@ void console_send_command(TCPSocket& client, char* cmd)
const char* delim = " ";
const char* token = strtok_r(cmd, delim, &saveptr);
+ if (token == NULL)
+ return;
+
json << "{\"type\":\"command\",\"args\":[";
while (token != NULL)
{
@@ -112,7 +112,8 @@ namespace Crown
if (text[0] == ':')
string[] args = text[1:text.length].split(" ");
- _console_client.send(DeviceApi.command(args));
+ if (args.length > 0)
+ _console_client.send(DeviceApi.command(args));
}
else