Fix: Verify that grid model is JSON object and not IPublishedContent (#9774)

This commit is contained in:
Jakob Bagterp
2021-02-21 11:47:35 +01:00
committed by GitHub
parent 63b417477b
commit f4e1b46968
2 changed files with 2 additions and 2 deletions

View File

@@ -6,7 +6,7 @@
Razor helpers located at the bottom of this file
*@
@if (Model != null && Model.sections != null)
@if (Model != null && Model.GetType() == typeof(JObject) && Model.sections != null)
{
var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1;

View File

@@ -2,7 +2,7 @@
@using Umbraco.Web.Templates
@using Newtonsoft.Json.Linq
@if (Model != null && Model.sections != null)
@if (Model != null && Model.GetType() == typeof(JObject) && Model.sections != null)
{
var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1;