From bdc849438d5d3b5314a8f70dbe220cc1c22cbb18 Mon Sep 17 00:00:00 2001 From: hwspeedy Date: Fri, 5 Apr 2024 09:56:10 +0200 Subject: FIX Json get array warning for non existing - check has member --- modules/benchmark.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/benchmark.c b/modules/benchmark.c index d4a39677..f3edd228 100644 --- a/modules/benchmark.c +++ b/modules/benchmark.c @@ -433,8 +433,8 @@ static GSList *benchmark_include_results_json(const gchar *path, if (json_node_get_node_type(root) != JSON_NODE_OBJECT) goto out; JsonObject *results = json_node_get_object(root); - if (results) { - JsonArray *machines = json_object_get_array_member(results, benchmark); + if ( results && json_object_has_member(results,benchmark) ) { + JsonArray *machines = json_object_get_array_member(results, benchmark); if (machines) { struct append_machine_result_json_data data = { -- cgit v1.2.3