From dcc6f17c9c54c7ec14cb5ce104d5df02f99e2a83 Mon Sep 17 00:00:00 2001 From: d11n Date: Mon, 11 Mar 2024 11:05:44 +0100 Subject: [PATCH] POS: Fix exception when asking for data with a top up item (#5816) Fixes #5811. --- .../PointOfSale/Controllers/UIPointOfSaleController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BTCPayServer/Plugins/PointOfSale/Controllers/UIPointOfSaleController.cs b/BTCPayServer/Plugins/PointOfSale/Controllers/UIPointOfSaleController.cs index 6b1f78e65..2ed29b23e 100644 --- a/BTCPayServer/Plugins/PointOfSale/Controllers/UIPointOfSaleController.cs +++ b/BTCPayServer/Plugins/PointOfSale/Controllers/UIPointOfSaleController.cs @@ -292,13 +292,13 @@ namespace BTCPayServer.Plugins.PointOfSale.Controllers } var amtField = form.GetFieldByFullName($"{FormDataService.InvoiceParameterPrefix}amount"); - if (amtField is null && price.HasValue) + if (amtField is null) { form.Fields.Add(new Field { Name = $"{FormDataService.InvoiceParameterPrefix}amount", Type = "hidden", - Value = price.ToString(), + Value = price?.ToString(), Constant = true }); }