From 3abcf52ad7c4ed1834d5a8704bf30428195359de Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Thu, 13 Jun 2019 05:13:34 +0200 Subject: [PATCH] mbox: fix clicking with no buttons (#1101) --- src/lv_objx/lv_mbox.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lv_objx/lv_mbox.c b/src/lv_objx/lv_mbox.c index 099a4b767..9c8db33df 100644 --- a/src/lv_objx/lv_mbox.c +++ b/src/lv_objx/lv_mbox.c @@ -448,10 +448,11 @@ static lv_res_t lv_mbox_signal(lv_obj_t * mbox, lv_signal_t sign, void * param) } } else if(sign == LV_SIGNAL_STYLE_CHG) { mbox_realign(mbox); - } else if(sign == LV_SIGNAL_RELEASED) { - uint16_t btn_id = lv_btnm_get_active_btn(ext->btnm); - if(btn_id != LV_BTNM_BTN_NONE) lv_event_send(mbox, LV_EVENT_SELECTED, &btn_id); + if(ext->btnm) { + uint16_t btn_id = lv_btnm_get_active_btn(ext->btnm); + if(btn_id != LV_BTNM_BTN_NONE) lv_event_send(mbox, LV_EVENT_SELECTED, &btn_id); + } } else if(sign == LV_SIGNAL_FOCUS || sign == LV_SIGNAL_DEFOCUS || sign == LV_SIGNAL_CONTROL || sign == LV_SIGNAL_GET_EDITABLE) { if(ext->btnm) {