Don't crash when calling popMenu() with empty stack.

Maybe quit button in main menu gets two click events while it's waiting for app destroy event.
This commit is contained in:
Deve
2018-12-31 00:06:42 +01:00
parent b7da5b243d
commit 17b83ac321

View File

@@ -209,6 +209,9 @@ void AbstractStateManager::popMenu()
{
assert(m_game_mode != GAME);
if (m_menu_stack.size() == 0)
return;
// Send tear-down event to menu
getCurrentScreen()->tearDown();
m_menu_stack.pop_back();