From ef63ea73c4a99460b1ca56655a79810562bc0368 Mon Sep 17 00:00:00 2001 From: Steve Date: Wed, 27 Apr 2016 09:56:03 +0100 Subject: [PATCH] Check that mission exists, before marking complete status. --- src/system/load.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; + } } }