diff --git a/src/guiengine/engine.cpp b/src/guiengine/engine.cpp index 6bf11f637..7335d11f7 100644 --- a/src/guiengine/engine.cpp +++ b/src/guiengine/engine.cpp @@ -132,7 +132,6 @@ void reshowCurrentScreen() // ----------------------------------------------------------------------------- Screen* getCurrentScreen() { - assert(g_current_screen != NULL); return g_current_screen; } // ----------------------------------------------------------------------------- diff --git a/src/states_screens/state_manager.cpp b/src/states_screens/state_manager.cpp index 81a14d3d9..27e711990 100644 --- a/src/states_screens/state_manager.cpp +++ b/src/states_screens/state_manager.cpp @@ -415,7 +415,9 @@ void StateManager::eventCallback(Widget* widget, const std::string& name) { std::cout << "event!! " << name.c_str() << std::endl; - const std::string& screen_name = getCurrentScreen()->getName(); + Screen* topScreen = getCurrentScreen(); + if (topScreen == NULL) return; + const std::string& screen_name = topScreen->getName(); if( screen_name == "main.stkgui" ) menuEventMain(widget, name);