1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

lv_list: lv_list_set_btn_selected: only write ext->last_sel if btn is non-NULL.

This commit is contained in:
Brian Pugh 2019-02-21 21:40:00 -08:00
parent a7260bbfa9
commit 465f8fa96a

View File

@ -300,7 +300,9 @@ void lv_list_set_btn_selected(lv_obj_t * list, lv_obj_t * btn)
} }
ext->selected_btn = btn; ext->selected_btn = btn;
if( btn != NULL ) {
ext->last_sel = btn; ext->last_sel = btn;
}
if(ext->selected_btn) { if(ext->selected_btn) {
lv_btn_state_t s = lv_btn_get_state(ext->selected_btn); lv_btn_state_t s = lv_btn_get_state(ext->selected_btn);