Check for invalid index in MenuBody::onDrawEnd(#57)
Method can get called before lines has data.
This commit is contained in:
+2
@@ -35,6 +35,8 @@ void MenuBody::onDrawBegin(uint16_t row, uint16_t col, lv_obj_draw_part_dsc_t* d
|
|||||||
|
|
||||||
void MenuBody::onDrawEnd(uint16_t row, uint16_t col, lv_obj_draw_part_dsc_t* dsc)
|
void MenuBody::onDrawEnd(uint16_t row, uint16_t col, lv_obj_draw_part_dsc_t* dsc)
|
||||||
{
|
{
|
||||||
|
if(row >= lines.size()) return;
|
||||||
|
|
||||||
lv_obj_t* icon = lines[row].getIcon();
|
lv_obj_t* icon = lines[row].getIcon();
|
||||||
if (icon) {
|
if (icon) {
|
||||||
lv_draw_img_dsc_t img_dsc;
|
lv_draw_img_dsc_t img_dsc;
|
||||||
|
|||||||
Reference in New Issue
Block a user