Skip to content

Commit

Permalink
null check
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeAlhayek committed Nov 5, 2024
1 parent c7c065c commit 1018f71
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
using OrchardCore.Modules;

namespace OrchardCore.Users.TimeZone.Services;
Expand Down Expand Up @@ -31,7 +30,7 @@ public Task<TimeZoneSelectorResult> GetTimeZoneAsync()
{
var timeZone = await _userTimeZoneService.GetAsync(_httpContextAccessor.HttpContext.User.Identity.Name);
return timeZone.TimeZoneId;
return timeZone?.TimeZoneId;
},
};

Expand Down

0 comments on commit 1018f71

Please sign in to comment.