Skip to content

Commit

Permalink
plugin/pay: fix crash if failcodename isn't set.
Browse files Browse the repository at this point in the history
Fixes: #7200
Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Aug 12, 2024
1 parent 48259af commit a243f3c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plugins/libplugin-pay.c
Original file line number Diff line number Diff line change
Expand Up @@ -2346,8 +2346,9 @@ static void payment_finished(struct payment *p)
json_add_u64(ret, "id", failure->id);

json_add_u32(ret, "failcode", failure->failcode);
json_add_string(ret, "failcodename",
failure->failcodename);
if (failure->failcodename)
json_add_string(ret, "failcodename",
failure->failcodename);

if (p->invstring)
json_add_invstring(ret, p->invstring);
Expand Down

0 comments on commit a243f3c

Please sign in to comment.