Fix for coverity #29386
authorTobias Markus <tobbi.bugs@googlemail.com>
Sun, 15 Feb 2015 18:16:10 +0000 (19:16 +0100)
committerTobias Markus <tobbi.bugs@googlemail.com>
Sun, 15 Feb 2015 18:16:10 +0000 (19:16 +0100)
src/supertux/game_session.cpp

index d64995b..57e48e4 100644 (file)
@@ -480,8 +480,11 @@ GameSession::update(float elapsed_time)
     }
   }
 
+  if(currentsector == NULL)
+    return;
+  
   // update sounds
-  if (currentsector && currentsector->camera) SoundManager::current()->set_listener_position(currentsector->camera->get_center());
+  if (currentsector->camera) SoundManager::current()->set_listener_position(currentsector->camera->get_center());
 
   /* Handle music: */
   if (end_sequence)