From 392eec237182c4cc669d23b797d7a4762d49693e Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 25 Aug 2021 11:56:20 +0200 Subject: [PATCH] Fixed potential null reference exception in KeepAlive --- src/Umbraco.Infrastructure/HostedServices/KeepAlive.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Infrastructure/HostedServices/KeepAlive.cs b/src/Umbraco.Infrastructure/HostedServices/KeepAlive.cs index 40c250f86e..644b2c278f 100644 --- a/src/Umbraco.Infrastructure/HostedServices/KeepAlive.cs +++ b/src/Umbraco.Infrastructure/HostedServices/KeepAlive.cs @@ -33,7 +33,7 @@ namespace Umbraco.Cms.Infrastructure.HostedServices /// /// Initializes a new instance of the class. /// - /// Accessor for the current request. + /// The current hosting environment /// Representation of the main application domain. /// The configuration for keep alive settings. /// The typed logger. @@ -86,7 +86,7 @@ namespace Umbraco.Cms.Infrastructure.HostedServices using (_profilingLogger.DebugDuration("Keep alive executing", "Keep alive complete")) { - var umbracoAppUrl = _hostingEnvironment.ApplicationMainUrl.ToString(); + var umbracoAppUrl = _hostingEnvironment.ApplicationMainUrl?.ToString(); if (umbracoAppUrl.IsNullOrWhiteSpace()) { _logger.LogWarning("No umbracoApplicationUrl for service (yet), skip.");