From f7d444dd15719dc41839df9ee13be686e5debe2d Mon Sep 17 00:00:00 2001 From: "antoine@DEVNET63-PC.wygwam.com" Date: Tue, 2 Oct 2012 11:01:56 +0200 Subject: [PATCH] #19066 Empty widget layer description causes null reference exception Work Item: 19066 --HG-- branch : 1.x --- .../Orchard.Widgets/Views/WidgetLayerVisibility.cshtml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Views/WidgetLayerVisibility.cshtml b/src/Orchard.Web/Modules/Orchard.Widgets/Views/WidgetLayerVisibility.cshtml index 15ca7bdd7..6d70930e0 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Views/WidgetLayerVisibility.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Views/WidgetLayerVisibility.cshtml @@ -6,7 +6,11 @@ } @functions { static string EncodeLineBreaks(string text) { - return text.Replace(Environment.NewLine, "\\\\n"); + if (!String.IsNullOrEmpty(text)){ + return text.Replace(Environment.NewLine, "\\\\n"); + } + + return text; } }