Skip to content

Commit

Permalink
Fix strange "error":null JSON node
Browse files Browse the repository at this point in the history
An `error` node with NULL value does not make much of a sense, but let's try to handle it.
Closes #3047

(cherry picked from commit 1a8f8e4)
  • Loading branch information
bogdan-iancu committed Apr 10, 2023
1 parent a1903b1 commit d59d433
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/jsonrpc/jsonrpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ static int jsonrpc_handle_cmd(union sockaddr_union *dst, char *cmd, int *id,
}

aux = cJSON_GetObjectItem(obj, "error");
if (aux) {
if (aux && aux->type!=cJSON_NULL) {
/* return the entire error */
vret->rs.s = cJSON_Print(aux);
vret->rs.len = strlen(vret->rs.s);
Expand Down

0 comments on commit d59d433

Please sign in to comment.