]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
robomon: avoid segfault when closing the map after an unsuccessfull atempt to open it
authorFilip Jares <filipjares@post.cz>
Sat, 24 Apr 2010 12:14:57 +0000 (14:14 +0200)
committerFilip Jares <filipjares@post.cz>
Sat, 24 Apr 2010 12:14:57 +0000 (14:14 +0200)
src/robomon/RobomonAtlantis.cpp

index 81d9aa82714b5acaab641bce04ce45a2fd9b3b94..30adbc16b9830bb1f3239af9f2b6091a10608349 100644 (file)
@@ -446,8 +446,10 @@ void RobomonAtlantis::showMap(bool show)
                connect(mapTimer, SIGNAL(timeout()), this, SLOT(paintMap()));
                mapTimer->start(200);
        } else {
-               mapTimer->stop();
-               disconnect(mapTimer, SIGNAL(timeout()), this, SLOT(paintMap()));
+               if(mapTimer != NULL) {
+                       mapTimer->stop();
+                       disconnect(mapTimer, SIGNAL(timeout()), this, SLOT(paintMap()));
+               }
        }
        playgroundScene->showMap(show);
 }