From 54e39fabb1be28786e3a67a52da36d83063b356d Mon Sep 17 00:00:00 2001 From: RaidMax Date: Fri, 10 Sep 2021 11:27:46 -0500 Subject: [PATCH] fix client history issue with empty database --- WebfrontCore/ViewComponents/ServerListViewComponent.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebfrontCore/ViewComponents/ServerListViewComponent.cs b/WebfrontCore/ViewComponents/ServerListViewComponent.cs index c49e14a41..75a4cabda 100644 --- a/WebfrontCore/ViewComponents/ServerListViewComponent.cs +++ b/WebfrontCore/ViewComponents/ServerListViewComponent.cs @@ -50,7 +50,7 @@ namespace WebfrontCore.ViewComponents { counts = counts.Union(server.ClientHistory .Select(history => history.ToClientCountSnapshot()).Where(history => - history.Time > clientHistory.ClientCounts.Last().Time)); + history.Time > (clientHistory.ClientCounts.LastOrDefault()?.Time ?? DateTime.MinValue))); } serverInfo.Add(new ServerInfo()