From 559a94af73843c421312975af818fbe77453bf6c Mon Sep 17 00:00:00 2001 From: Sebastien Ros Date: Wed, 19 May 2010 10:29:55 -0700 Subject: [PATCH] Corrected internal exception when a Page content is empty --HG-- branch : dev --- src/Orchard.Web/Core/Common/Drivers/BodyDriver.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Orchard.Web/Core/Common/Drivers/BodyDriver.cs b/src/Orchard.Web/Core/Common/Drivers/BodyDriver.cs index 04d56dc88..f7a0a0264 100644 --- a/src/Orchard.Web/Core/Common/Drivers/BodyDriver.cs +++ b/src/Orchard.Web/Core/Common/Drivers/BodyDriver.cs @@ -104,6 +104,10 @@ namespace Orchard.Core.Common.Drivers { // Can be moved somewhere else once we have IoC enabled body text filters. private static string BbcodeReplace(string bodyText) { + + if ( string.IsNullOrEmpty(bodyText) ) + return string.Empty; + Regex urlRegex = new Regex(@"\[url\]([^\]]+)\[\/url\]"); Regex urlRegexWithLink = new Regex(@"\[url=([^\]]+)\]([^\]]+)\[\/url\]"); Regex imgRegex = new Regex(@"\[img\]([^\]]+)\[\/img\]");