Bugfix (segfault when starting a game after finishing all levels).
[evilplumber] / src / game.cpp
index 41bff30..6b8aa20 100644 (file)
@@ -594,6 +594,13 @@ void LevelSwitcher::chooseLevelCollection()
             first = false;
         }
     }
+
+    if (first) {
+        // None of the rows got the focus yet; set it to the first
+        // item
+        levelList->setCurrentItem(levelList->item(0));
+    }
+
     gameWidget->hide();
     startWidget->hide();
     levelWidget->show();