Skip to content
This repository was archived by the owner on Feb 10, 2024. It is now read-only.

Commit cc8b7cb

Browse files
committed
DocTypeGridEditorHelper - added null reference check on the JSON data
I encountered an edge-case where a DTGE grid cell was created without any JSON data, storing the value as `null`. This was passed through to the `ConvertValueToContent` method, causing the `JsonConvert` deserializer to throw a null-reference exception.
1 parent df1fc50 commit cc8b7cb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Our.Umbraco.DocTypeGridEditor/Helpers/DocTypeGridEditorHelper.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ public static IPublishedContent ConvertValueToContent(string id, string contentT
2828
if (string.IsNullOrWhiteSpace(contentTypeAlias))
2929
return null;
3030

31+
if (dataJson == null)
32+
return null;
33+
3134
if (UmbracoContext.Current == null)
3235
return ConvertValue(id, contentTypeAlias, dataJson);
3336

0 commit comments

Comments
 (0)