msgbox.cpp: fix possible crash if no buttons defined

Origin commit data
------------------
Commit: e2946e7229
Author: Thilo Graf <dbt@novatux.de>
Date: 2020-11-24 (Tue, 24 Nov 2020)
This commit is contained in:
2020-11-24 15:04:35 +01:00
committed by vanhofen
parent c0b8b69a5e
commit d3784fd467

View File

@@ -265,7 +265,10 @@ int CMsgBox::exec()
neutrino_msg_data_t data;
int res = menu_return::RETURN_REPAINT;
ccw_footer->getSelectedButtonObject()->setButtonAlias(mb_show_button);
CComponentsButton *btn = ccw_footer->getSelectedButtonObject();
if (btn)
btn->setButtonAlias(mb_show_button);
int selected = ccw_footer->getSelectedButton();
if (timeout == NO_TIMEOUT)
timeout = 0;