When a user is deleted there is a bug when accessing a recipe page with that user's comments since the system tries to access the author property which doesn't exists anymore.
I covered it up with an if statement
@if (comment.CommentAuthor != null)
{
}
this allows the comment to be displayed without the user name displayed above it, but in the future, no one can delete or modify that comment since the author doesn't exists anymore. It might be best to delete a user's comments when a user is deleted.
When a user is deleted there is a bug when accessing a recipe page with that user's comments since the system tries to access the author property which doesn't exists anymore.
I covered it up with an if statement
@if (comment.CommentAuthor != null)
{
@comment.CommentAuthor.UserName
}
this allows the comment to be displayed without the user name displayed above it, but in the future, no one can delete or modify that comment since the author doesn't exists anymore. It might be best to delete a user's comments when a user is deleted.