mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
json-rpc: translate NULL into "null" instead of "(null)".
This commit is contained in:
parent
ca487d5115
commit
d86ad15b53
@ -290,6 +290,12 @@ static void connection_complete_error(struct json_connection *jcon,
|
|||||||
else
|
else
|
||||||
data_str = "";
|
data_str = "";
|
||||||
|
|
||||||
|
/*
|
||||||
|
tal_fmt translates NULL into "(null)", which is not valid JSON.
|
||||||
|
Prevent this by pre-emptively translating NULL into "null".
|
||||||
|
*/
|
||||||
|
if(id == NULL) id = "null";
|
||||||
|
|
||||||
json_done(jcon, cmd, take(tal_fmt(tmpctx,
|
json_done(jcon, cmd, take(tal_fmt(tmpctx,
|
||||||
"{ \"jsonrpc\": \"2.0\", "
|
"{ \"jsonrpc\": \"2.0\", "
|
||||||
" \"error\" : "
|
" \"error\" : "
|
||||||
|
Loading…
Reference in New Issue
Block a user