Skip to content

Commit

Permalink
fix(ui): Check object exists access before accessing it (EdgeTX#2886)
Browse files Browse the repository at this point in the history
  • Loading branch information
gagarinlg authored and mha1 committed Dec 22, 2022
1 parent 6ae7a0b commit 108eb12
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions radio/src/gui/colorlcd/view_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,13 @@ bool ViewMain::enableWidgetSelect(bool enable)
widget_select = enable;

lv_obj_t* tile = lv_tileview_get_tile_act(tile_view);
if(!tile)
return true;

auto cont_obj = lv_obj_get_child(tile, 0);
if(!cont_obj)
return true;

auto cont = (WidgetsContainer*)lv_obj_get_user_data(cont_obj);

for (uint32_t i = 0; i < cont->getZonesCount(); i++) {
Expand Down

0 comments on commit 108eb12

Please sign in to comment.