changeset 23:3866c19535fd

Fix NullReferenceException when checks are executed on a brand new server.
author Brad Greco <brad@bgreco.net>
date Thu, 30 May 2019 21:40:27 -0400
parents 48044d9ac000
children 06ff59b59e70
files ServerMonitor/Forms/ServerSummaryForm.cs
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ServerMonitor/Forms/ServerSummaryForm.cs	Thu May 30 21:40:02 2019 -0400
+++ b/ServerMonitor/Forms/ServerSummaryForm.cs	Thu May 30 21:40:27 2019 -0400
@@ -127,7 +127,7 @@
         /// <param name="server">The server to refresh.</param>
         private void RefreshServer(Server server)
         {
-            ServerPanel.Controls.Cast<ServerSummaryControl>().FirstOrDefault(c => c.Server == server).Refresh();
+            ServerPanel.Controls.Cast<ServerSummaryControl>().FirstOrDefault(c => c.Server == server)?.Refresh();
             // The server's status might have changed, so refresh the form icon.
             UpdateIcon();
         }