diff --git a/src/Yavsc/Extensions/PermissionHandler.cs b/src/Yavsc/Extensions/PermissionHandler.cs index 7e4e7a3f..15f168ec 100644 --- a/src/Yavsc/Extensions/PermissionHandler.cs +++ b/src/Yavsc/Extensions/PermissionHandler.cs @@ -73,10 +73,11 @@ public class PermissionHandler : IAuthorizationHandler "/Blogspot/Delete", StringComparison.OrdinalIgnoreCase)) { - string postId = (string) httpContext.GetRouteValue("id"); + string? postId = (string?) httpContext.GetRouteValue("id"); if (long.TryParse(postId, out long id)) { - BlogPost b = applicationDbContext.BlogSpot.FirstOrDefault(b => b.Id == id && b.AuthorId == user.GetUserId()); + BlogPost? b = applicationDbContext.BlogSpot.FirstOrDefault + (b => b.Id == id && b.AuthorId == user.GetUserId()); return b != null; } }