Skip to content

Commit

Permalink
Don't use ternary operator for JSON validator check (see #3466)
Browse files Browse the repository at this point in the history
  • Loading branch information
lminiero committed Nov 25, 2024
1 parent b04234c commit 623e567
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/plugins/janus_sip.c
Original file line number Diff line number Diff line change
Expand Up @@ -3990,10 +3990,15 @@ static void *janus_sip_handler(void *data) {
goto error;
}
janus_mutex_unlock(&session->mutex);
struct janus_json_parameter *params = progress ? progress_parameters : accept_parameters;
JANUS_VALIDATE_JSON_OBJECT(root, params,
error_code, error_cause, TRUE,
JANUS_SIP_ERROR_MISSING_ELEMENT, JANUS_SIP_ERROR_INVALID_ELEMENT);
if(progress) {
JANUS_VALIDATE_JSON_OBJECT(root, progress_parameters,
error_code, error_cause, TRUE,
JANUS_SIP_ERROR_MISSING_ELEMENT, JANUS_SIP_ERROR_INVALID_ELEMENT);
} else {
JANUS_VALIDATE_JSON_OBJECT(root, accept_parameters,
error_code, error_cause, TRUE,
JANUS_SIP_ERROR_MISSING_ELEMENT, JANUS_SIP_ERROR_INVALID_ELEMENT);
}
if(error_code != 0)
goto error;
json_t *srtp = json_object_get(root, "srtp");
Expand Down

0 comments on commit 623e567

Please sign in to comment.