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

Commit 450c8f2

Browse files
committed
Fix datavalue reference so other editors than DTGE doesnt break when saving
1 parent 3fd1b6d commit 450c8f2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Our.Umbraco.DocTypeGridEditor/ValueProcessing/DocTypeGridEditorDataValueReference.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Newtonsoft.Json;
2+
using Newtonsoft.Json.Linq;
23
using Our.Umbraco.DocTypeGridEditor.Models;
34
using System;
45
using System.Collections.Generic;
@@ -71,7 +72,7 @@ internal GridValue DeserializeGridValue(string rawJson, out IEnumerable<DocTypeG
7172
{
7273
// Find all controls that uses DTGE editor
7374
var controls = grid.Sections.SelectMany(x => x.Rows.SelectMany(r => r.Areas).SelectMany(a => a.Controls)).ToArray();
74-
dtgeValues = controls.Where(x => x.Value["dtgeContentTypeAlias"] != null).Select(x => x.Value.ToObject<DocTypeGridEditorValue>());
75+
dtgeValues = controls.Where(x => x.Value is JObject && x.Value["dtgeContentTypeAlias"] != null).Select(x => x.Value.ToObject<DocTypeGridEditorValue>());
7576
}
7677
else
7778
{

0 commit comments

Comments
 (0)