Resolved issue with 24hr/historic price values sometimes being null at source
This commit is contained in:
parent
eadebfb8ff
commit
7b1178abf8
@ -44,7 +44,7 @@ namespace MarketPriceLookup.Common.Helpers
|
|||||||
// iterate over all items returned and filter out bad prices
|
// iterate over all items returned and filter out bad prices
|
||||||
foreach (var item in parsedResponse.data.items)
|
foreach (var item in parsedResponse.data.items)
|
||||||
{
|
{
|
||||||
if (item.historicalPrices.Length == 0)
|
if (item.historicalPrices == null || item.historicalPrices.Length == 0)
|
||||||
{
|
{
|
||||||
LoggingHelpers.LogError($"unable to add item {item.id} {item.name} with no historical prices, ignoring");
|
LoggingHelpers.LogError($"unable to add item {item.id} {item.name} with no historical prices, ignoring");
|
||||||
continue;
|
continue;
|
||||||
@ -88,7 +88,7 @@ namespace MarketPriceLookup.Common.Helpers
|
|||||||
{
|
{
|
||||||
Name = item.name,
|
Name = item.name,
|
||||||
//Price = price,
|
//Price = price,
|
||||||
Average24hPrice = item.avg24hPrice,
|
Average24hPrice = item.avg24hPrice ?? 0,
|
||||||
Average7DaysPrice = averagedItemPrice,
|
Average7DaysPrice = averagedItemPrice,
|
||||||
PricePoints = item.historicalPrices.Length,
|
PricePoints = item.historicalPrices.Length,
|
||||||
//Trader = trader,
|
//Trader = trader,
|
||||||
|
@ -16,7 +16,7 @@ namespace MarketPriceLookup.Common.Helpers
|
|||||||
public class Item
|
public class Item
|
||||||
{
|
{
|
||||||
public string name { get; set; }
|
public string name { get; set; }
|
||||||
public int avg24hPrice { get; set; }
|
public int? avg24hPrice { get; set; }
|
||||||
public double? changeLast48hPercent { get; set; }
|
public double? changeLast48hPercent { get; set; }
|
||||||
public string id { get; set; }
|
public string id { get; set; }
|
||||||
public HistoricalPrice[] historicalPrices { get; set; }
|
public HistoricalPrice[] historicalPrices { get; set; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user