checking decoded_buffer for NULL

This commit is contained in:
Václav Šmejkal 2024-01-30 21:01:07 +01:00
parent f6d005551a
commit b41d5703f4
Signed by: ENGO150
GPG Key ID: 4A57E86482968843

View File

@ -500,6 +500,12 @@ void *why2_communicate_thread(void *arg)
decoded_buffer = get_string_from_json_string(raw, "message"); //DECODE
if (decoded_buffer == NULL) //idk sometimes this happen, idk why
{
force_exiting = 1;
goto deallocation;
}
if (decoded_buffer[0] == '!') //COMMANDS
{
if (strcmp(decoded_buffer, "!exit") == 0) //USER REQUESTED EXIT