(buttonbar_call): fix possible NULL dereference.

Signed-off-by: Andrew V. Samoilov <a.samoilov@gmail.com>
This commit is contained in:
Andrew V. Samoilov 2017-05-13 12:57:58 +03:00 committed by Andrew Borodin
parent d2cfb712b0
commit bf5abff937

View File

@ -149,10 +149,11 @@ buttonbar_call (WButtonBar * bb, int i)
Widget *w = WIDGET (bb);
Widget *target;
target = (bb->labels[i].receiver != NULL) ? bb->labels[i].receiver : WIDGET (w->owner);
if ((bb != NULL) && (bb->labels[i].command != CK_IgnoreKey))
{
target = (bb->labels[i].receiver != NULL) ? bb->labels[i].receiver : WIDGET (w->owner);
ret = send_message (target, w, MSG_ACTION, bb->labels[i].command, NULL);
}
return ret;
}