diff --git a/src/playsingle_controller.cpp b/src/playsingle_controller.cpp index 55c80fba163d..8343469250d1 100644 --- a/src/playsingle_controller.cpp +++ b/src/playsingle_controller.cpp @@ -273,8 +273,9 @@ LEVEL_RESULT playsingle_controller::play_scenario(const config& level) const bool is_victory = get_end_level_data_const().is_victory; if(gamestate().gamedata_.phase() <= game_data::PRESTART) { - // TODO: does this need an if-not-null check? - gui_->video().get_window()->fill(0, 0, 0, 255); + if(sdl::window* window = gui_->video().get_window()) { + window->fill(0, 0, 0, 255); + } } ai_testing::log_game_end();