From b41d5703f4c66b780250b09aac1cb0fa55e3e044 Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Tue, 30 Jan 2024 21:01:07 +0100 Subject: [PATCH] checking decoded_buffer for NULL --- src/chat/misc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/chat/misc.c b/src/chat/misc.c index 08477e7..c05ce76 100644 --- a/src/chat/misc.c +++ b/src/chat/misc.c @@ -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