From 37de9464e14adad54dc9e3d9e0e58188aac2136a Mon Sep 17 00:00:00 2001 From: aristocratos Date: Fri, 24 Sep 2021 20:58:58 +0200 Subject: [PATCH] Fixed: Crash when opening menu at too small size --- src/btop_menu.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/btop_menu.cpp b/src/btop_menu.cpp index b166c1e..3128544 100644 --- a/src/btop_menu.cpp +++ b/src/btop_menu.cpp @@ -1341,11 +1341,11 @@ namespace Menu { menuMask.reset(); menuMask.set(SizeError); } - else { - for (const auto& i : iota(0, (int)menuMask.size())) { - if (menuMask.test(i)) currentMenu = i; - } + + for (const auto& i : iota(0, (int)menuMask.size())) { + if (menuMask.test(i)) currentMenu = i; } + } auto retCode = menuFunc.at(currentMenu)(key);