add null check
authornemo
Sun, 28 Nov 2010 13:12:00 -0500
changeset 4429 f9a949ef955b
parent 4428 2bc3d3475edf
child 4430 cacda05a053e
add null check
QTfrontend/hwform.cpp
--- a/QTfrontend/hwform.cpp	Sun Nov 28 12:55:57 2010 -0500
+++ b/QTfrontend/hwform.cpp	Sun Nov 28 13:12:00 2010 -0500
@@ -77,6 +77,7 @@
 #ifdef USE_XFIRE
     xfire_init();
 #endif
+    game = NULL;
     gameSettings = new QSettings(cfgdir->absolutePath() + "/hedgewars.ini", QSettings::IniFormat);
     frontendEffects = gameSettings->value("frontend/effects", true).toBool();
     playerHash = QString(QCryptographicHash::hash(gameSettings->value("net/nick","").toString().toLatin1(), QCryptographicHash::Md5).toHex());
@@ -511,7 +512,7 @@
         ui.pageNetGame->pChatWidget->loadLists(ui.pageOptions->editNetNick->text());
 // joining the lobby 
     else if(id == ID_PAGE_ROOMSLIST) {
-        if ( game && game->gameState == gsStarted) { // abnormal exit - kick or room destruction - send kills.
+        if ( hwnet && game && game->gameState == gsStarted) { // abnormal exit - kick or room destruction - send kills.
             game->KillAllTeams();
         }
         ui.pageRoomsList->chatWidget->loadLists(ui.pageOptions->editNetNick->text());