Fix crash on loading garbage game file
[xboard.git] / gamelist.c
index 2626839..a36af7a 100644 (file)
@@ -304,6 +304,7 @@ int GameListBuild(f)
         case BlackWins:
         case GameIsDrawn:
         case GameUnfinished:
+           if(!currentListGame) break;
            if (currentListGame->gameInfo.resultDetails != NULL) {
                free(currentListGame->gameInfo.resultDetails);
            }