From fa87d808dc4e198a09cea418cae08d79c12a9dec Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Tue, 27 Feb 2024 19:00:10 +0000 Subject: [PATCH] fix: fix rare assertion error --- OliverBooth/Pages/Shared/_AdminLayout.cshtml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/OliverBooth/Pages/Shared/_AdminLayout.cshtml b/OliverBooth/Pages/Shared/_AdminLayout.cshtml index 10fda4d..635cf59 100644 --- a/OliverBooth/Pages/Shared/_AdminLayout.cshtml +++ b/OliverBooth/Pages/Shared/_AdminLayout.cshtml @@ -1,4 +1,3 @@ -@using System.Diagnostics @using OliverBooth.Data.Blog @using OliverBooth.Data.Web @using OliverBooth.Services @@ -17,7 +16,6 @@ { UserService.TryGetUser(session.UserId, out user); } - Debug.Assert(user is not null); } @@ -98,7 +96,7 @@ Blog Posts - @if (user.HasPermission("projects:read")) + @if (user?.HasPermission("projects:read") != true) {
  • @@ -106,7 +104,7 @@
  • } - @if (user.HasPermission("users:read")) + @if (user?.HasPermission("users:read") != true) {
  • @@ -118,8 +116,8 @@