manager: Tolerate stasis messages with no channel snapshot.

In some cases I have yet to determine some stasis messages may
be created without a channel snapshot. This change adds some
tolerance to this scenario, preventing a crash from occurring.

(cherry picked from commit 07d798875d)
This commit is contained in:
Joshua C. Colp 2023-08-09 07:57:33 -03:00 committed by Asterisk Development Team
parent 68fc422247
commit 592c85b8de
1 changed files with 1 additions and 1 deletions

View File

@ -493,7 +493,7 @@ struct ast_str *ast_manager_build_channel_state_string_prefix(
char *connected_name;
int res;
if (snapshot->base->tech_properties & AST_CHAN_TP_INTERNAL) {
if (!snapshot || (snapshot->base->tech_properties & AST_CHAN_TP_INTERNAL)) {
return NULL;
}