Skip to content

Commit

Permalink
dialog: prevent dlg_onreq from crashing
Browse files Browse the repository at this point in the history
Check if current_context_ptr exists before trying to fetch the dialog

Fixes #1719
  • Loading branch information
razvancrainea committed Jun 3, 2019
1 parent e50a3d3 commit 5e4a99e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/dialog/dlg_handlers.c
Expand Up @@ -1124,7 +1124,7 @@ void dlg_onreq(struct cell* t, int type, struct tmcb_params *param)
struct dlg_cell *dlg;

/* is the dialog already created? */
if ( (dlg=ctx_dialog_get())!=NULL ) {
if (current_processing_ctx && (dlg=ctx_dialog_get())!=NULL ) {
/* new, un-initialized dialog ? */
if ( dlg->flags & DLG_FLAG_ISINIT ) {
/* fully init dialog -> check if attached to the transaction */
Expand Down

0 comments on commit 5e4a99e

Please sign in to comment.