Skip to content

Commit

Permalink
libplugin-pay: fix valgrind error
Browse files Browse the repository at this point in the history
for the case rpc "listpeers" returns an error, such as in shutdown
  • Loading branch information
SimonVrouwe authored and rustyrussell committed Nov 30, 2021
1 parent aae5e78 commit e08528b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/libplugin-pay.c
Original file line number Diff line number Diff line change
Expand Up @@ -3231,7 +3231,7 @@ static struct command_result *direct_pay_listpeers(struct command *cmd,
json_to_listpeers_result(tmpctx, buffer, toks);
struct direct_pay_data *d = payment_mod_directpay_get_data(p);

if (tal_count(r->peers) == 1) {
if (r && tal_count(r->peers) == 1) {
struct listpeers_peer *peer = r->peers[0];
if (!peer->connected)
goto cont;
Expand Down

0 comments on commit e08528b

Please sign in to comment.