mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-19 05:44:12 +01:00
json_add_invoice: fix crash if missing invstring
If this field is missing for whatever reason (weird db state?) clightning will crash when listing invoices. Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
parent
167fade0fa
commit
ff84b3f773
@ -39,7 +39,8 @@ static void json_add_invoice(struct json_stream *response,
|
||||
const struct invoice_details *inv)
|
||||
{
|
||||
json_add_escaped_string(response, "label", inv->label);
|
||||
json_add_invstring(response, inv->invstring);
|
||||
if (inv->invstring)
|
||||
json_add_invstring(response, inv->invstring);
|
||||
json_add_sha256(response, "payment_hash", &inv->rhash);
|
||||
if (inv->msat)
|
||||
json_add_amount_msat_compat(response, *inv->msat,
|
||||
|
Loading…
Reference in New Issue
Block a user