Skip to content

Commit 1a8f8e4

Browse files
committed
Fix strange "error":null JSON node
An `error` node with NULL value does not make much of a sense, but let's try to handle it. Closes #3047
1 parent d8b28e4 commit 1a8f8e4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/jsonrpc/jsonrpc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ static int jsonrpc_handle_cmd(union sockaddr_union *dst, char *cmd, int *id,
339339
}
340340

341341
aux = cJSON_GetObjectItem(obj, "error");
342-
if (aux) {
342+
if (aux && aux->type!=cJSON_NULL) {
343343
/* return the entire error */
344344
vret->rs.s = cJSON_Print(aux);
345345
vret->rs.len = strlen(vret->rs.s);

0 commit comments

Comments
 (0)