From 763bf2eb31df7e009fd31f7c0ecd81e5bb1f7e76 Mon Sep 17 00:00:00 2001 From: HojouFotytu <36724681+HojouFotytu@users.noreply.github.com> Date: Sun, 14 Apr 2024 08:36:18 +0900 Subject: [PATCH] Fix Empty Months --- Core/DataObjects/ProfitTrailerData.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Core/DataObjects/ProfitTrailerData.cs b/Core/DataObjects/ProfitTrailerData.cs index c4008b1..264e5b9 100644 --- a/Core/DataObjects/ProfitTrailerData.cs +++ b/Core/DataObjects/ProfitTrailerData.cs @@ -567,7 +567,10 @@ namespace Core.Main.DataObjects if (extraSection != null) { JArray monthlyStatsSection = (JArray)extraSection["monthlyStats"]; - _monthlyStats = monthlyStatsSection.Select(j => BuildMonthlyStatsData(j as JObject)).ToList(); + _monthlyStats = monthlyStatsSection + .Where(j => j["totalSales"] != null && (double)j["totalSales"] != 0 && j["avgGrowth"] != null) + .Select(j => BuildMonthlyStatsData(j as JObject)) + .ToList(); _monthlyStatsRefresh = DateTime.UtcNow.AddSeconds(_systemConfiguration.GeneralSettings.Monitor.DashboardChartsRefreshSeconds - 1); } }