modem_chat: fix hard fault on script stop

Fix fault on modem_cellular disconnection/reconnection
Issue #64291

Signed-off-by: romain pelletant <romainp@kickmaker.net>
This commit is contained in:
romain pelletant 2023-10-24 14:05:57 +02:00 committed by Carles Cufí
parent f2b3a5ea3a
commit efebb1841f

View File

@ -60,6 +60,10 @@ static void modem_chat_log_received_command(struct modem_chat *chat)
static void modem_chat_script_stop(struct modem_chat *chat, enum modem_chat_script_result result)
{
if (!chat || !chat->script) {
return;
}
/* Handle result */
if (result == MODEM_CHAT_SCRIPT_RESULT_SUCCESS) {
LOG_DBG("%s: complete", chat->script->name);