summaryrefslogtreecommitdiffstats
path: root/ahl-binding/role.cpp
diff options
context:
space:
mode:
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;