(dlg_run_done): fix possible NULL dereference.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2018-08-04 19:10:27 +03:00
parent b9194d8c8a
commit 669a8e3e17

View File

@ -1172,7 +1172,7 @@ dlg_run_done (WDialog * h)
if (widget_get_state (WIDGET (h), WST_CLOSED)) if (widget_get_state (WIDGET (h), WST_CLOSED))
{ {
send_message (h, h->current->data, MSG_END, 0, NULL); send_message (h, h->current == NULL ? NULL : WIDGET (h->current->data), MSG_END, 0, NULL);
if (!widget_get_state (WIDGET (h), WST_MODAL)) if (!widget_get_state (WIDGET (h), WST_MODAL))
dialog_switch_remove (h); dialog_switch_remove (h);
} }