Skip to content

Commit

Permalink
fix: read json file error
Browse files Browse the repository at this point in the history
  • Loading branch information
DuanKuanJun committed May 21, 2024
1 parent 958b2bb commit 14d2d68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/benchJsonOpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1427,7 +1427,7 @@ static int getMetaFromCommonJsonFile(tools_cJSON *json) {

g_arguments->csvPath[0] = 0;
tools_cJSON *csv = tools_cJSON_GetObjectItem(json, "csvPath");
if (csvPath && (csv->type == tools_cJSON_String)
if (csv && (csv->type == tools_cJSON_String)
&& (csv->valuestring != NULL)) {
tstrncpy(g_arguments->csvPath, csv->valuestring, MAX_FILE_NAME_LEN);
}
Expand Down

0 comments on commit 14d2d68

Please sign in to comment.