summaryrefslogtreecommitdiffstats
path: root/ahl-binding/role.cpp
diff options
context:
space:
mode:
authorThierry Bultel <thierry.bultel@iot.bzh>2018-07-04 12:38:27 +0200
committerLoïc Collignon <loic.collignon@iot.bzh>2018-07-10 18:15:01 +0200
commite2e78437b472dc40e605cdcd895804105a680a1f (patch)
tree83d2554d82e64d59c8c5e4a848c47507f80000d1 /ahl-binding/role.cpp
parent7275efd56abe3bc02b6f630dc18b415916e7f030 (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.cpp10
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;