diff --git a/BTCPayServer/Plugins/NFC/NFCController.cs b/BTCPayServer/Plugins/NFC/NFCController.cs index db43ac429..a09749770 100644 --- a/BTCPayServer/Plugins/NFC/NFCController.cs +++ b/BTCPayServer/Plugins/NFC/NFCController.cs @@ -175,18 +175,18 @@ namespace BTCPayServer.Plugins.NFC } } - if (bolt11 is null) + if (string.IsNullOrEmpty(bolt11)) { return BadRequest("Could not fetch BOLT11 invoice to pay to."); } var result = await info.SendRequest(bolt11, httpClient); - if (result.Status.Equals("ok", StringComparison.InvariantCultureIgnoreCase)) + if (!string.IsNullOrEmpty(result.Status) && result.Status.Equals("ok", StringComparison.InvariantCultureIgnoreCase)) { return Ok(result.Reason); } - return BadRequest(result.Reason); + return BadRequest(result.Reason ?? "Unknown error"); } } } diff --git a/BTCPayServer/Views/Shared/NFC/CheckoutEnd.cshtml b/BTCPayServer/Views/Shared/NFC/CheckoutEnd.cshtml index b0a2b4f61..e30ea250a 100644 --- a/BTCPayServer/Views/Shared/NFC/CheckoutEnd.cshtml +++ b/BTCPayServer/Views/Shared/NFC/CheckoutEnd.cshtml @@ -5,9 +5,11 @@