mirror of
https://github.com/aljazceru/BTCPayServerPlugins.git
synced 2025-12-17 23:54:26 +01:00
Fix: BlinkLightningClient.GetInvoice should not crash when the invoice is not found
This commit is contained in:
@@ -179,9 +179,8 @@ query InvoiceByPaymentHash($paymentHash: PaymentHash!, $walletId: WalletId!) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
var response = await _client.SendQueryAsync<dynamic>(reques, cancellation);
|
var response = await _client.SendQueryAsync<dynamic>(reques, cancellation);
|
||||||
|
var result = response.Data?.SelectToken("me.defaultAccount.walletById.invoiceByPaymentHash") as JObject;
|
||||||
|
return result is null ? null : ToInvoice(result);
|
||||||
return response.Data is null ? null : ToInvoice(response.Data.me.defaultAccount.walletById.invoiceByPaymentHash);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public LightningInvoice? ToInvoice(JObject invoice)
|
public LightningInvoice? ToInvoice(JObject invoice)
|
||||||
|
|||||||
Reference in New Issue
Block a user