mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 08:51:04 +02:00
cc_frm; cc_button_select: Avoid possible crash if no item is selectable
Origin commit data
------------------
Commit: 6c511e9ccb
Author: Thilo Graf <dbt@novatux.de>
Date: 2020-12-07 (Mon, 07 Dec 2020)
This commit is contained in:
@@ -67,8 +67,10 @@ void CCButtonSelect::setSelectedButton( size_t item_id,
|
||||
btn->setButtonTextColor(text_col);
|
||||
}
|
||||
}
|
||||
if (!btn)
|
||||
dprintf(DEBUG_NORMAL, "\033[33m[CCButtonSelect]\t[%s - %d], no button object found...\033[0m\n", __func__, __LINE__);
|
||||
if (!btn){
|
||||
dprintf(DEBUG_NORMAL, "\033[31m[CCButtonSelect]\t[%s - %d], ERROR: btn_container size = %d, no button object available...\033[0m\n", __func__, __LINE__, (int)btn_container->size());
|
||||
return;
|
||||
}
|
||||
|
||||
fb_pixel_t sel_col = fr_col;
|
||||
if (btn_container->size() > 1)
|
||||
|
@@ -711,6 +711,8 @@ CComponentsItem* CComponentsForm::getSelectedItemObject() const
|
||||
CComponentsItem* ret = NULL;
|
||||
if (sel != -1)
|
||||
ret = static_cast<CComponentsItem*>(this->getCCItem(sel));
|
||||
else
|
||||
dprintf(DEBUG_NORMAL, "\033[31m[CComponentsForm]\t[%s - %d], ERROR: no item object found...\033[0m\n", __func__, __LINE__);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user