Fix for coverity #29370
authorTobias Markus <tobbi@mozilla-uk.org>
Sat, 14 Feb 2015 16:47:40 +0000 (17:47 +0100)
committerTobias Markus <tobbi@mozilla-uk.org>
Sat, 14 Feb 2015 16:47:40 +0000 (17:47 +0100)
src/worldmap/worldmap.cpp

index e5fba03..4aa05c7 100644 (file)
@@ -481,6 +481,10 @@ WorldMap::finished_level(Level* gamelevel)
   // TODO use Level* parameter here?
   LevelTile* level = at_level();
 
+  if(level == NULL) {
+    return;
+  }
+
   bool old_level_state = level->solved;
   level->solved = true;
   level->sprite->set_action("solved");