Skip to content

Commit

Permalink
Revert "remove redundant line causing NullReferenceException when slu…
Browse files Browse the repository at this point in the history
…g is empty (madskristensen#52)"

This reverts commit a9f62a4.
  • Loading branch information
marcoskirchner authored Aug 19, 2020
1 parent 3c67ccc commit 6008715
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Controllers/BlogController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ public async Task<IActionResult> UpdatePost(Post post)
.ToList()
.ForEach(existing.Categories.Add);
existing.Title = post.Title.Trim();
existing.Slug = post.Slug.Trim();
existing.Slug = !string.IsNullOrWhiteSpace(post.Slug) ? post.Slug.Trim() : Models.Post.CreateSlug(post.Title);
existing.IsPublished = post.IsPublished;
existing.Content = post.Content.Trim();
Expand Down

0 comments on commit 6008715

Please sign in to comment.