From f9923c2f16e4a64547df8b745aa664e16df2e252 Mon Sep 17 00:00:00 2001 From: Shreyas Zare Date: Sat, 6 Nov 2021 13:35:42 +0530 Subject: [PATCH] Failover.HealthMonitor: fixed LastHealthCheckResponse property to not return null values. --- Apps/FailoverApp/HealthMonitor.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Apps/FailoverApp/HealthMonitor.cs b/Apps/FailoverApp/HealthMonitor.cs index 3b693907..d17fd4c3 100644 --- a/Apps/FailoverApp/HealthMonitor.cs +++ b/Apps/FailoverApp/HealthMonitor.cs @@ -21,7 +21,7 @@ using DnsServerCore.ApplicationCommon; using System; using System.Net; using System.Threading; -using TechnitiumLibrary.Net.Dns; +using TechnitiumLibrary.Net.Dns.ResourceRecords; namespace Failover { @@ -310,6 +310,10 @@ namespace Failover get { _lastHealthStatusCheckedOn = DateTime.UtcNow; + + if (_lastHealthCheckResponse is null) + return new HealthCheckResponse(HealthStatus.Unknown); + return _lastHealthCheckResponse; } }