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))