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

Commit 29684ae

Browse files
committed
Fix datavalue reference so other editors than DTGE doesnt break when saving
1 parent 32ce274 commit 29684ae

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
@@ -11,6 +11,7 @@
1111
using Umbraco.Extensions;
1212
using Newtonsoft.Json;
1313
using Our.Umbraco.DocTypeGridEditor.Models;
14+
using Newtonsoft.Json.Linq;
1415

1516
namespace Our.Umbraco.DocTypeGridEditor.ValueProcessing
1617
{
@@ -75,7 +76,7 @@ internal GridValue DeserializeGridValue(string rawJson, out IEnumerable<DocTypeG
7576
{
7677
// Find all controls that uses DTGE editor
7778
var controls = grid.Sections.SelectMany(x => x.Rows.SelectMany(r => r.Areas).SelectMany(a => a.Controls)).ToArray();
78-
dtgeValues = controls.Where(x => x.Value["dtgeContentTypeAlias"] != null).Select(x => x.Value.ToObject<DocTypeGridEditorValue>());
79+
dtgeValues = controls.Where(x => x.Value is JObject && x.Value["dtgeContentTypeAlias"] != null).Select(x => x.Value.ToObject<DocTypeGridEditorValue>());
7980
}
8081
else
8182
{

0 commit comments

Comments
 (0)