Check that mission exists, before marking complete status.

This commit is contained in:
Steve 2016-04-27 09:56:03 +01:00
parent fe597ebb9c
commit ef63ea73c4
1 changed files with 5 additions and 1 deletions

View File

@ -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;
}
}
}