From e2e78437b472dc40e605cdcd895804105a680a1f Mon Sep 17 00:00:00 2001 From: Thierry Bultel Date: Wed, 4 Jul 2018 12:38:27 +0200 Subject: Fixed compilation warnings with latest jsonc Change-Id: I87a8c0ba3fdccf6bddd6f4fb7982225c1399f130 Signed-off-by: Thierry Bultel --- ahl-binding/jsonc_utils.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'ahl-binding/jsonc_utils.hpp') diff --git a/ahl-binding/jsonc_utils.hpp b/ahl-binding/jsonc_utils.hpp index 5e82fca..097eda4 100644 --- a/ahl-binding/jsonc_utils.hpp +++ b/ahl-binding/jsonc_utils.hpp @@ -81,11 +81,15 @@ inline std::string& jcast(std::string& v, json_object* o) template inline T& jcast(T& v, json_object* o, std::string field) { - return jcast(v, json_object_object_get(o, field.c_str())); + json_object * value; + json_object_object_get_ex(o, field.c_str(), &value); + return jcast(v, value); } template inline T& jcast_array(T& v, json_object* o, std::string field) { - return jcast_array(v, json_object_object_get(o, field.c_str())); + json_object * value; + json_object_object_get_ex(o, field.c_str(), &value); + return jcast_array(v, value); } -- cgit 1.2.3-korg