mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-02-22 22:54:23 +01:00
fix crash on not found perk items (#3685)
This commit is contained in:
@@ -214,11 +214,11 @@ namespace BTCPayServer.Services.Apps
|
||||
return rate * value;
|
||||
}));
|
||||
var itemCode = entities.Key;
|
||||
var perk = perks.First(p => p.Id == itemCode);
|
||||
var perk = perks.FirstOrDefault(p => p.Id == itemCode);
|
||||
return new ItemStats
|
||||
{
|
||||
ItemCode = itemCode,
|
||||
Title = perk.Title,
|
||||
Title = perk?.Title ?? itemCode,
|
||||
SalesCount = entities.Count(),
|
||||
Total = total,
|
||||
TotalFormatted = $"{total.ShowMoney(currencyData.Divisibility)} {settings.TargetCurrency}"
|
||||
|
||||
Reference in New Issue
Block a user