Skip to content

Commit 393372c

Browse files
When we can't find a property stored in a Nested/Inner content item, it doesn't need to throw
The property could have been stored once and then removed from the datatype definition Fixes #8
1 parent b60f217 commit 393372c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,10 @@ public void SetValue(IContentBase content, string alias, string value)
181181
var propertyType = contentType.CompositionPropertyTypes.FirstOrDefault(x => x.Alias == key);
182182

183183
if (propertyType == null)
184-
throw new NullReferenceException($"No Property Type found with alias {key} on Content Type {contentType.Alias}");
184+
{
185+
LogHelper.Debug<InnerContentConnector>($"No Property Type found with alias {key} on Content Type {contentType.Alias}");
186+
continue;
187+
}
185188

186189
// throws if not found - no need for a null check
187190
var propValueConnector = ValueConnectors.Get(propertyType);

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,10 @@ public void SetValue(IContentBase content, string alias, string value)
197197
var propertyType = contentType.CompositionPropertyTypes.FirstOrDefault(x => x.Alias == key);
198198

199199
if (propertyType == null)
200-
throw new NullReferenceException($"No Property Type found with alias {key} on Content Type {contentType.Alias}");
200+
{
201+
LogHelper.Debug<NestedContentValueConnector>($"No Property Type found with alias {key} on Content Type {contentType.Alias}");
202+
continue;
203+
}
201204

202205
// throws if not found - no need for a null check
203206
var propValueConnector = ValueConnectors.Get(propertyType);

0 commit comments

Comments
 (0)