summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mir_app/src/menu_utils.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mir_app/src/menu_utils.cpp b/src/mir_app/src/menu_utils.cpp
index 4fd6bc56a9..d06a1e0263 100644
--- a/src/mir_app/src/menu_utils.cpp
+++ b/src/mir_app/src/menu_utils.cpp
@@ -1041,6 +1041,11 @@ int Menu_LoadFromDatabase(TMO_IntMenuItem *pimi, void *szModule)
if (p == NULL)
return 0;
+ if (p == pimi) { // prevent a loop
+ Netlib_Logf(NULL, "MENU: preventing endless loop in %s", menuItemName);
+ return 0;
+ }
+
pimi->mi.root = p;
pNew = &p->submenu;
}