POS: Fix null pointer

Introduced in #4307, the referenced object needs to be `itemChoice` instead of `choice`.
This commit is contained in:
d11n 2022-11-21 22:07:46 +01:00 committed by GitHub
parent eda0f7327e
commit 850c26dc13
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -200,9 +200,9 @@ namespace BTCPayServer.Plugins.PointOfSale.Controllers
}
decimal expectedCartItemPrice = 0;
if (choice.Price.Type != ViewPointOfSaleViewModel.Item.ItemPrice.ItemPriceType.Topup)
if (itemChoice.Price.Type != ViewPointOfSaleViewModel.Item.ItemPrice.ItemPriceType.Topup)
{
expectedCartItemPrice = choice.Price.Value ?? 0;
expectedCartItemPrice = itemChoice.Price.Value ?? 0;
}
expectedMinimumAmount += expectedCartItemPrice * cartItem.Value;