From 307a06ae8b5b9a9f5e081e100a3928ca86c37d9e Mon Sep 17 00:00:00 2001 From: liwenqiang Date: Wed, 10 Jul 2019 19:46:42 +0800 Subject: [PATCH] fix Blog Entity content is empty or null will throw IndexOutOfRangeException --- .../src/Volo.Blogging.Web/Pages/Blog/BloggingPage.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/BloggingPage.cs b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/BloggingPage.cs index 1c954bd58d..ed3bb0971c 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/BloggingPage.cs +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/BloggingPage.cs @@ -34,7 +34,10 @@ namespace Volo.Blogging.Pages.Blog var closingTag = "

"; var html = RenderMarkdownToString(content); - + if (string.IsNullOrWhiteSpace(html)) + { + return ""; + } var splittedHtml = html.Split(closingTag); if (splittedHtml.Length < 1)