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
committerThierry Bultel <thierry.bultel@iot.bzh>2018-07-04 12:38:27 +0200
commitcf9c83ca5375f7daa199866545f00e211d038b15 (patch)
tree3724154f1692310c9bda68ed1aa9e753a4419267 /ahl-binding/role.cpp
parent56f9d67e5856aed4f6349769fd262217497f6bc5 (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;