mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
libplugin-pay: fix valgrind error
for the case rpc "listpeers" returns an error, such as in shutdown
This commit is contained in:
parent
aae5e7822f
commit
e08528b7b5
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user