Skip to content

Commit

Permalink
Fixed create/attach management with null optional args (fixes #2490)
Browse files Browse the repository at this point in the history
  • Loading branch information
lminiero committed Dec 14, 2020
1 parent 746c8bd commit e82a06b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion janus.c
Original file line number Diff line number Diff line change
Expand Up @@ -994,9 +994,13 @@ int janus_process_incoming_request(janus_request *request) {
/* Ok, let's start with the ids */
guint64 session_id = 0, handle_id = 0;
json_t *s = json_object_get(root, "session_id");
if(json_is_null(s))
s = NULL;
if(s && json_is_integer(s))
session_id = json_integer_value(s);
json_t *h = json_object_get(root, "handle_id");
if(json_is_null(h))
h = NULL;
if(h && json_is_integer(h))
handle_id = json_integer_value(h);

Expand Down Expand Up @@ -1098,7 +1102,7 @@ int janus_process_incoming_request(janus_request *request) {
}
if(h && handle_id < 1) {
JANUS_LOG(LOG_ERR, "Invalid handle\n");
ret = janus_process_error(request, session_id, transaction_text, JANUS_ERROR_SESSION_NOT_FOUND, NULL);
ret = janus_process_error(request, session_id, transaction_text, JANUS_ERROR_HANDLE_NOT_FOUND, NULL);
goto jsondone;
}

Expand Down

0 comments on commit e82a06b

Please sign in to comment.