summaryrefslogtreecommitdiff
path: root/src/jobs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/jobs.c')
-rw-r--r--src/jobs.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/jobs.c b/src/jobs.c
index 845df08..cb5fe3b 100644
--- a/src/jobs.c
+++ b/src/jobs.c
@@ -332,15 +332,16 @@ int job_read(FILE *stream, struct job **job)
goto out_free;
}
- temp = cJSON_GetObjectItemCaseSensitive(root, "system");
- if (!cJSON_IsString(temp)) {
- ret = JOB_READ_JSON_INVAL;
- goto out_free;
- }
- if (evanix_opts.system != NULL &&
- strcmp(evanix_opts.system, temp->valuestring)) {
- ret = JOB_READ_SYS_MISMATCH;
- goto out_free;
+ if (evanix_opts.system != NULL) {
+ temp = cJSON_GetObjectItemCaseSensitive(root, "system");
+ if (!cJSON_IsString(temp)) {
+ ret = JOB_READ_JSON_INVAL;
+ goto out_free;
+ }
+ if (strcmp(evanix_opts.system, temp->valuestring)) {
+ ret = JOB_READ_SYS_MISMATCH;
+ goto out_free;
+ }
}
temp = cJSON_GetObjectItemCaseSensitive(root, "name");