Fix potential NullReferenceException

This commit is contained in:
Vitor Rodrigues
2023-10-08 12:28:36 +02:00
committed by Emma L Garland
parent 5c514ca6c6
commit 53b152d501

View File

@@ -27,7 +27,7 @@ internal class AspNetCoreSessionManager : ISessionIdResolver, ISessionManager
/// <summary>
/// If session isn't enabled this will throw an exception so we check
/// </summary>
private bool IsSessionsAvailable => !(_httpContextAccessor.HttpContext?.Features.Get<ISessionFeature>() is null);
private bool IsSessionsAvailable => !(_httpContextAccessor.HttpContext?.Features.Get<ISessionFeature>()?.Session is null);
public string? GetSessionValue(string key)
{