mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 08:51:10 +02:00
CLuaInstance::MenuAddItem: Fix neutrino segfault at (type == "chooser")
when options in lua script broken
This commit is contained in:
@@ -934,6 +934,10 @@ int CLuaInstance::MenuAddItem(lua_State *L)
|
||||
options_count++;
|
||||
}
|
||||
lua_pop(L, 1);
|
||||
if (options_count == 0) {
|
||||
m->m->addItem(new CMenuSeparator(CMenuSeparator::STRING | CMenuSeparator::LINE, "ERROR! (options_count)", NONEXISTANT_LOCALE));
|
||||
return 0;
|
||||
}
|
||||
|
||||
CMenuOptionChooser::keyval_ext *kext = (CMenuOptionChooser::keyval_ext *)calloc(options_count, sizeof(CMenuOptionChooser::keyval_ext));
|
||||
m->tofree.push_back(kext);
|
||||
|
Reference in New Issue
Block a user