Skip to content

Commit 50f862a

Browse files
authored
Merge pull request #51 from mattbrailsford/patch-2
Null check `blockEditorValue.Settings` before concatenating with `blockEditorValue.Content`
2 parents 4e2f534 + 26e750c commit 50f862a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Umbraco.Deploy.Contrib/ValueConnectors/BlockEditorValueConnector.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public virtual string ToArtifact(object value, IPropertyType propertyType, IColl
6969
return null;
7070
}
7171

72-
var allBlocks = blockEditorValue.Content.Concat(blockEditorValue.Settings).ToList();
72+
var allBlocks = blockEditorValue.Content.Concat(blockEditorValue.Settings ?? Enumerable.Empty<Block>()).ToList();
7373

7474
// get all the content types used in block editor items
7575
var allContentTypes = allBlocks.Select(x => x.ContentTypeKey)
@@ -148,7 +148,7 @@ public virtual object FromArtifact(string value, IPropertyType propertyType, obj
148148
if (blockEditorValue == null)
149149
return value;
150150

151-
var allBlocks = blockEditorValue.Content.Concat(blockEditorValue.Settings).ToList();
151+
var allBlocks = blockEditorValue.Content.Concat(blockEditorValue.Settings ?? Enumerable.Empty<Block>()).ToList();
152152

153153
var allContentTypes = allBlocks.Select(x => x.ContentTypeKey)
154154
.Distinct()

0 commit comments

Comments
 (0)