Skip to content

Commit 28235b7

Browse files
author
Warren Buckley
authored
Merge pull request #50 from prjseal/patch-1
Fixed null error
2 parents 1345a60 + 510afa4 commit 28235b7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Our.Umbraco.TagHelpers/Services/BackofficeUserAccessor.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ public ClaimsIdentity BackofficeUser
4242
return new ClaimsIdentity();
4343

4444
AuthenticationTicket? unprotected = cookieOptions.TicketDataFormat.Unprotect(backOfficeCookie!);
45-
ClaimsIdentity backOfficeIdentity = unprotected!.Principal.GetUmbracoIdentity();
45+
ClaimsIdentity? backOfficeIdentity = unprotected?.Principal.GetUmbracoIdentity();
4646

47-
return backOfficeIdentity;
47+
return backOfficeIdentity ?? new ClaimsIdentity();
4848
}
4949
}
5050
}
51-
}
51+
}

0 commit comments

Comments
 (0)