From b3cace1b5c15ba320ec62355fe7b4418a3629908 Mon Sep 17 00:00:00 2001 From: Simon Dingley Date: Tue, 10 Nov 2015 12:18:44 +0000 Subject: [PATCH] Fixes Issue #38 Returns null if there are no objects in the collection therefore not breaking recursive property lookups --- .../PropertyEditors/NestedContentPropertyEditor.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Our.Umbraco.NestedContent/PropertyEditors/NestedContentPropertyEditor.cs b/src/Our.Umbraco.NestedContent/PropertyEditors/NestedContentPropertyEditor.cs index 8364f79..bde35e2 100644 --- a/src/Our.Umbraco.NestedContent/PropertyEditors/NestedContentPropertyEditor.cs +++ b/src/Our.Umbraco.NestedContent/PropertyEditors/NestedContentPropertyEditor.cs @@ -262,7 +262,11 @@ public override object ConvertEditorToDb(ContentPropertyData editorValue, object var value = JsonConvert.DeserializeObject>(editorValue.Value.ToString()); if (value == null) - return string.Empty; + return null; + + // Issue #38 - Keep recursive property lookups working + if (!value.Any()) + return null; // Process value for (var i = 0; i < value.Count; i++)