From 7d5c5cb20e51cc796ee1c6f616070d7a8be81add Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Sat, 9 May 2015 16:08:32 +0200 Subject: [PATCH] main: assert that startup screen pointer is not null --- src/ncmpcpp.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ncmpcpp.cpp b/src/ncmpcpp.cpp index b01c13d1..23c8dde2 100644 --- a/src/ncmpcpp.cpp +++ b/src/ncmpcpp.cpp @@ -135,7 +135,11 @@ int main(int argc, char **argv) // go to startup screen if (Config.startup_screen_type != myScreen->type()) - toScreen(Config.startup_screen_type)->switchTo(); + { + auto startup_screen = toScreen(Config.startup_screen_type); + assert(startup_screen != nullptr); + startup_screen->switchTo(); + } // lock current screen and go to the slave one if applicable if (Config.startup_slave_screen_type)