Skip to content

Commit 16cd10d

Browse files
authored
Merge pull request #18 from umbraco/temp-deploy-493
fixes deploy-493 InnerContent connector has a regression issue with g…
2 parents 2f29469 + 392586a commit 16cd10d

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/Umbraco.Deploy.Contrib.Connectors/ValueConnectors/InnerContentConnector.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ public string GetValue(Property property, ICollection<ArtifactDependency> depend
6363
var distinctContentTypes = new Dictionary<GuidUdi, IContentType>();
6464
foreach (var innerContentItem in innerContent)
6565
{
66-
var contentType = _contentTypeService.GetContentType(innerContentItem.IcContentTypeGuid);
66+
IContentType contentType = null;
67+
if (innerContentItem.IcContentTypeGuid.HasValue)
68+
contentType = _contentTypeService.GetContentType(innerContentItem.IcContentTypeGuid.Value);
6769
if (contentType == null)
6870
contentType = _contentTypeService.GetContentType(innerContentItem.IcContentTypeAlias);
6971
if (contentType == null)
@@ -146,13 +148,14 @@ public void SetValue(IContentBase content, string alias, string value)
146148

147149
foreach (var innerContentItem in innerContent)
148150
{
149-
var contentType = _contentTypeService.GetContentType(innerContentItem.IcContentTypeGuid);
151+
IContentType contentType = null;
152+
if (innerContentItem.IcContentTypeGuid.HasValue)
153+
contentType = _contentTypeService.GetContentType(innerContentItem.IcContentTypeGuid.Value);
150154
if (contentType == null)
151155
contentType = _contentTypeService.GetContentType(innerContentItem.IcContentTypeAlias);
152156
if (contentType == null)
153157
throw new InvalidOperationException($"Could not resolve these content types for the Inner Content property with key: {innerContentItem.Key}, and name: {innerContentItem.Name}");
154158

155-
156159
var mocks = new Dictionary<IContentType, IContent>();
157160

158161
// note
@@ -243,7 +246,7 @@ public class InnerContentValue
243246
[JsonProperty("icContentTypeAlias")]
244247
public string IcContentTypeAlias { get; set; }
245248
[JsonProperty("icContentTypeGuid")]
246-
public Guid IcContentTypeGuid { get; set; }
249+
public Guid? IcContentTypeGuid { get; set; }
247250

248251
/// <summary>
249252
/// The remaining properties will be serialized to a dictionary

0 commit comments

Comments
 (0)