Skip to content

json-rpc: translate NULL into "null" instead of "(null)". #1118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 28, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lightningd/jsonrpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@ static void connection_complete_ok(struct json_connection *jcon,
const char *id,
const struct json_result *result)
{
assert(id != NULL);

/* This JSON is simple enough that we build manually */
json_done(jcon, cmd, take(tal_fmt(jcon,
"{ \"jsonrpc\": \"2.0\", "
Expand Down Expand Up @@ -290,6 +292,8 @@ static void connection_complete_error(struct json_connection *jcon,
else
data_str = "";

assert(id != NULL);

json_done(jcon, cmd, take(tal_fmt(tmpctx,
"{ \"jsonrpc\": \"2.0\", "
" \"error\" : "
Expand Down Expand Up @@ -685,7 +689,7 @@ static struct io_plan *read_json(struct io_conn *conn,
"Invalid token in json input: '%.*s'",
(int)jcon->used, jcon->buffer);
json_command_malformed(
jcon, NULL,
jcon, "null",
"Invalid token in json input");
return io_halfclose(conn);
}
Expand Down