From a46b86b243effe1e915e74b869e1d23b246defa5 Mon Sep 17 00:00:00 2001 From: Matthew Harris Date: Thu, 29 Sep 2016 20:48:22 +0100 Subject: [PATCH] Fixes #7120 Hidden Field in Dynamic Forms causes crash (#7123) Fixes #7120 - If a Hidden Field is added to a DynamicForm without a Value set then it will crash the front end because of a null value. --- .../Orchard.DynamicForms/Drivers/HiddenFieldElementDriver.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/HiddenFieldElementDriver.cs b/src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/HiddenFieldElementDriver.cs index 1206b6d94..62448c847 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/HiddenFieldElementDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/HiddenFieldElementDriver.cs @@ -36,7 +36,7 @@ namespace Orchard.DynamicForms.Drivers { protected override void OnDisplaying(HiddenField element, ElementDisplayingContext context) { context.ElementShape.ProcessedName = _tokenizer.Replace(element.Name, context.GetTokenData()); - context.ElementShape.ProcessedValue = element.RuntimeValue; + context.ElementShape.ProcessedValue = element.RuntimeValue ?? string.Empty; } } -} \ No newline at end of file +}