From 534ee846fa7caca17f9581ff93f23fd4a6a6a54b Mon Sep 17 00:00:00 2001 From: Kevin Jump Date: Fri, 21 Jun 2024 16:40:15 +0100 Subject: [PATCH] Fix #653 - Check for null 'allowedContentTypes' --- .../Serialization/Serializers/ContentTypeBaseSerializer.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/uSync.Core/Serialization/Serializers/ContentTypeBaseSerializer.cs b/uSync.Core/Serialization/Serializers/ContentTypeBaseSerializer.cs index 281f956e..509e113a 100644 --- a/uSync.Core/Serialization/Serializers/ContentTypeBaseSerializer.cs +++ b/uSync.Core/Serialization/Serializers/ContentTypeBaseSerializer.cs @@ -180,6 +180,8 @@ protected XElement SerializeStructure(TObject item) var node = new XElement("Structure"); List> items = new List>(); + if (item.AllowedContentTypes is null) return node; + foreach (var allowedType in item.AllowedContentTypes.OrderBy(x => x.SortOrder)) { var allowedItem = FindItem(allowedType.Id.Value);