Check for existence of active when loading.

This commit is contained in:
Steve 2018-02-12 19:15:20 +00:00
parent ca5ce089d2
commit c47a15b88a
1 changed files with 4 additions and 1 deletions

View File

@ -116,7 +116,10 @@ static void load(cJSON *root)
s = (Structure*)self;
s->active = cJSON_GetObjectItem(root, "active")->valueint;
if (cJSON_GetObjectItem(root, "active"))
{
s->active = cJSON_GetObjectItem(root, "active")->valueint;
}
STRNCPY(s->requiredItem, cJSON_GetObjectItem(root, "requiredCard")->valuestring, MAX_NAME_LENGTH);
STRNCPY(s->targetNames, cJSON_GetObjectItem(root, "targetNames")->valuestring, MAX_DESCRIPTION_LENGTH);
}