Skip to content

Commit

Permalink
chore(group):avoid null pointer access (lvgl#5864)
Browse files Browse the repository at this point in the history
  • Loading branch information
cnjhb authored Mar 17, 2024
1 parent 20ac90d commit b4bdc9e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core/lv_group.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,9 @@ void lv_group_swap_obj(lv_obj_t * obj1, lv_obj_t * obj2)
else if((*obj_i) == obj2)(*obj_i) = obj1;
}

if(*g1->obj_focus == obj1) lv_group_focus_obj(obj2);
else if(*g1->obj_focus == obj2) lv_group_focus_obj(obj1);
lv_obj_t * focused = lv_group_get_focused(g1);
if(focused == obj1) lv_group_focus_obj(obj2);
else if(focused == obj2) lv_group_focus_obj(obj1);

}

Expand Down

0 comments on commit b4bdc9e

Please sign in to comment.