mirror of
https://github.com/aljazceru/BTCPayServerPlugins.git
synced 2025-12-16 23:24:25 +01:00
Merge pull request #99 from NicolasDorier/fix-not-found-inv
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);
|
||||
|
||||
|
||||
return response.Data is null ? null : ToInvoice(response.Data.me.defaultAccount.walletById.invoiceByPaymentHash);
|
||||
var result = response.Data?.SelectToken("me.defaultAccount.walletById.invoiceByPaymentHash") as JObject;
|
||||
return result is null ? null : ToInvoice(result);
|
||||
}
|
||||
|
||||
public LightningInvoice? ToInvoice(JObject invoice)
|
||||
|
||||
Reference in New Issue
Block a user