From c41b1cb4580789fb43409e50a4e9190eebea8b32 Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Sun, 2 Oct 2022 14:34:34 +0200 Subject: [PATCH] fix(Menu): handle negative selection index properly --- radio/src/thirdparty/libopenui/src/menu.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/radio/src/thirdparty/libopenui/src/menu.cpp b/radio/src/thirdparty/libopenui/src/menu.cpp index c5bd07f1d..179f3473a 100644 --- a/radio/src/thirdparty/libopenui/src/menu.cpp +++ b/radio/src/thirdparty/libopenui/src/menu.cpp @@ -176,6 +176,12 @@ void MenuBody::setIndex(int index) lv_obj_invalidate(lvobj); lv_table_t* table = (lv_table_t*)lvobj; + + if (index < 0) { + table->row_act = LV_TABLE_CELL_NONE; + table->col_act = LV_TABLE_CELL_NONE; + return; + } table->row_act = index; table->col_act = 0;