Add some checks to Menu::closeAll() to avoid accessing null pointers

These are not reproducible situations, but we've received a crash
report that indicates that these pointers can be null if some
unknown scenario.
This commit is contained in:
David Capello 2015-09-16 10:52:02 -03:00
parent c674c474f6
commit 182a094f2b

View File

@ -1125,7 +1125,15 @@ void Menu::closeAll()
}
MenuBox* base_menubox = get_base_menubox(menu->getParent());
ASSERT(base_menubox);
if (!base_menubox)
return;
MenuBaseData* base = base_menubox->getBase();
ASSERT(base);
if (!base)
return;
base->close_all = true;
base->was_clicked = false;
if (base->is_filtering) {