diff --git a/src/system/load.c b/src/system/load.c index 67beeb8..24e07be 100644 --- a/src/system/load.c +++ b/src/system/load.c @@ -73,7 +73,11 @@ static void loadMissions(cJSON *missionsJSON) for (missionJSON = missionsJSON->child ; missionJSON != NULL ; missionJSON = missionJSON->next) { mission = getMission(cJSON_GetObjectItem(missionJSON, "filename")->valuestring); - mission->completed = cJSON_GetObjectItem(missionJSON, "completed")->valueint; + + if (mission) + { + mission->completed = cJSON_GetObjectItem(missionJSON, "completed")->valueint; + } } }