From 1018f71bf706af10e9c357b518a6da427496d65c Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Tue, 5 Nov 2024 15:57:56 -0800 Subject: [PATCH] null check --- .../TimeZone/Services/UserTimeZoneSelector.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/OrchardCore.Modules/OrchardCore.Users/TimeZone/Services/UserTimeZoneSelector.cs b/src/OrchardCore.Modules/OrchardCore.Users/TimeZone/Services/UserTimeZoneSelector.cs index 20b4edc8bf2..b0523e7e639 100644 --- a/src/OrchardCore.Modules/OrchardCore.Users/TimeZone/Services/UserTimeZoneSelector.cs +++ b/src/OrchardCore.Modules/OrchardCore.Users/TimeZone/Services/UserTimeZoneSelector.cs @@ -1,5 +1,4 @@ using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Identity; using OrchardCore.Modules; namespace OrchardCore.Users.TimeZone.Services; @@ -31,7 +30,7 @@ public Task GetTimeZoneAsync() { var timeZone = await _userTimeZoneService.GetAsync(_httpContextAccessor.HttpContext.User.Identity.Name); - return timeZone.TimeZoneId; + return timeZone?.TimeZoneId; }, };