diff options
Diffstat (limited to '4a-hal')
-rw-r--r-- | 4a-hal/4a-hal-controllers/4a-hal-controllers-alsacore-link.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/4a-hal/4a-hal-controllers/4a-hal-controllers-alsacore-link.c b/4a-hal/4a-hal-controllers/4a-hal-controllers-alsacore-link.c index c35b3cc..13e1c1d 100644 --- a/4a-hal/4a-hal-controllers/4a-hal-controllers-alsacore-link.c +++ b/4a-hal/4a-hal-controllers/4a-hal-controllers-alsacore-link.c @@ -467,14 +467,9 @@ void HalCtlsActionOnAlsaCtl(AFB_ReqT request) return; } - switch(json_object_get_type(requestJson)) { - case json_type_object : - case json_type_array : - break; - - default: - AFB_ReqFailF(request, "request_json", "Request json is not valid '%s'", json_object_get_string(requestJson)); - return; + if(! json_object_is_type(requestJson, json_type_object)) { + AFB_ReqFailF(request, "request_json", "Request json is not valid '%s'", json_object_get_string(requestJson)); + return; } snprintf(cardIdString, 6, "hw:%i", currentCtlHalData->sndCardId); |