From 53b152d501425365d6ddc85da346a148bc2415ae Mon Sep 17 00:00:00 2001 From: Vitor Rodrigues Date: Sun, 8 Oct 2023 12:28:36 +0200 Subject: [PATCH] Fix potential NullReferenceException --- src/Umbraco.Web.Common/AspNetCore/AspNetCoreSessionManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.Common/AspNetCore/AspNetCoreSessionManager.cs b/src/Umbraco.Web.Common/AspNetCore/AspNetCoreSessionManager.cs index 1813c75932..ad5f480a72 100644 --- a/src/Umbraco.Web.Common/AspNetCore/AspNetCoreSessionManager.cs +++ b/src/Umbraco.Web.Common/AspNetCore/AspNetCoreSessionManager.cs @@ -27,7 +27,7 @@ internal class AspNetCoreSessionManager : ISessionIdResolver, ISessionManager /// /// If session isn't enabled this will throw an exception so we check /// - private bool IsSessionsAvailable => !(_httpContextAccessor.HttpContext?.Features.Get() is null); + private bool IsSessionsAvailable => !(_httpContextAccessor.HttpContext?.Features.Get()?.Session is null); public string? GetSessionValue(string key) {