From c79fbdbf92c72cfc8f493ade3d8ae1f10a82403a Mon Sep 17 00:00:00 2001 From: Uncled1023 Date: Mon, 30 May 2022 14:15:00 -0700 Subject: [PATCH] Fixed null reference --- Teknik/Areas/User/Views/User/ViewProfile.cshtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Teknik/Areas/User/Views/User/ViewProfile.cshtml b/Teknik/Areas/User/Views/User/ViewProfile.cshtml index 5afe256..a2992d5 100644 --- a/Teknik/Areas/User/Views/User/ViewProfile.cshtml +++ b/Teknik/Areas/User/Views/User/ViewProfile.cshtml @@ -6,7 +6,7 @@
@if (!Model.Error) { - bool OwnProfile = (Model.Username == User.Identity.Name || User.IsInRole("Admin")) && User.Identity.IsAuthenticated; + bool OwnProfile = (User.Identity?.IsAuthenticated ?? false) && (Model.Username == User.Identity?.Name || User.IsInRole("Admin")); string gitHost = Config.GitConfig.Host; string gitFullUrl = string.Empty; if (!string.IsNullOrEmpty(gitHost))