From eee8bd55651729c6a61d7e126c30b8c99bc4ad58 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Wed, 3 Nov 2021 14:42:46 +0100 Subject: [PATCH] Fixed missing null check in BlockEditorPropertyEditor (#11184) Thanks @lauraneto - reviewed this and your fix solves the issue. #h5yr (cherry picked from commit 23d21062773889916fbe2c14f32158dce282e1f1) # Conflicts: # src/Umbraco.Web/PropertyEditors/BlockEditorPropertyEditor.cs --- src/Umbraco.Web/PropertyEditors/BlockEditorPropertyEditor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web/PropertyEditors/BlockEditorPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/BlockEditorPropertyEditor.cs index b2eab4f8ab65..16907edd0bdc 100644 --- a/src/Umbraco.Web/PropertyEditors/BlockEditorPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/BlockEditorPropertyEditor.cs @@ -258,7 +258,7 @@ public IEnumerable Validate(object value, string valueType, ob _textService.Localize("validation", "entriesShort", new[] { validationLimit.Min.ToString(), - (validationLimit.Min - blockEditorData.Layout.Count()).ToString() + (validationLimit.Min - (blockEditorData?.Layout.Count() ?? 0)).ToString() }), new[] { "minCount" }); }