diff options
author | Thierry Bultel <thierry.bultel@iot.bzh> | 2018-07-04 12:38:27 +0200 |
---|---|---|
committer | Loïc Collignon <loic.collignon@iot.bzh> | 2018-07-10 18:15:01 +0200 |
commit | e2e78437b472dc40e605cdcd895804105a680a1f (patch) | |
tree | 83d2554d82e64d59c8c5e4a848c47507f80000d1 /ahl-binding/role.cpp | |
parent | 7275efd56abe3bc02b6f630dc18b415916e7f030 (diff) |
Fixed compilation warnings with latest jsonc
Change-Id: I87a8c0ba3fdccf6bddd6f4fb7982225c1399f130
Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
Diffstat (limited to 'ahl-binding/role.cpp')
-rw-r--r-- | ahl-binding/role.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ahl-binding/role.cpp b/ahl-binding/role.cpp index 5215a60..5b2f95e 100644 --- a/ahl-binding/role.cpp +++ b/ahl-binding/role.cpp @@ -168,8 +168,9 @@ void role_t::invoke(afb_request* req) return; } - json_object* jaction = json_object_object_get(arg, "action"); - if (jaction == nullptr) + json_object* jaction; + json_bool ret = json_object_object_get_ex(arg, "action", &jaction); + if (!ret) { afb_request_fail(req, "No valid action!", nullptr); return; @@ -248,8 +249,9 @@ void role_t::volume(afb_request* r, json_object* o) AFB_DYNAPI_NOTICE(ahl_binding_t::instance().handle(), "Granted special audio-mixer permission to change volume"); } - json_object* value = json_object_object_get(o, "value"); - if(!value) + json_object* value; + json_bool ret = json_object_object_get_ex(o, "value", &value); + if (!ret) { afb_request_fail(r, "No value given!", nullptr); return; |