Skip to content

Commit 06ae5bc

Browse files
authored
Merge pull request #9 from umbraco/temp-8
Error: No Property Type found with alias {key} on Content Type {contentType.Alias}
2 parents cd8e6bb + 9398a68 commit 06ae5bc

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using Newtonsoft.Json.Linq;
66
using Umbraco.Core;
77
using Umbraco.Core.Deploy;
8+
using Umbraco.Core.Logging;
89
using Umbraco.Core.Models;
910
using Umbraco.Core.Services;
1011
using Umbraco.Deploy.ValueConnectors;
@@ -84,7 +85,10 @@ public string GetValue(Property property, ICollection<ArtifactDependency> depend
8485
var propertyType = contentType.CompositionPropertyTypes.FirstOrDefault(x => x.Alias == key);
8586

8687
if (propertyType == null)
87-
throw new NullReferenceException($"No Property Type found with alias {key} on Content Type {contentType.Alias}");
88+
{
89+
LogHelper.Debug<InnerContentConnector>($"No Property Type found with alias {key} on Content Type {contentType.Alias}");
90+
continue;
91+
}
8892

8993
// throws if not found - no need for a null check
9094
var propValueConnector = ValueConnectors.Get(propertyType);
@@ -177,7 +181,10 @@ public void SetValue(IContentBase content, string alias, string value)
177181
var propertyType = contentType.CompositionPropertyTypes.FirstOrDefault(x => x.Alias == key);
178182

179183
if (propertyType == null)
180-
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+
}
181188

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

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using Newtonsoft.Json.Linq;
66
using Umbraco.Core;
77
using Umbraco.Core.Deploy;
8+
using Umbraco.Core.Logging;
89
using Umbraco.Core.Models;
910
using Umbraco.Core.Services;
1011
using Umbraco.Deploy.ValueConnectors;
@@ -91,7 +92,10 @@ public string GetValue(Property property, ICollection<ArtifactDependency> depend
9192
var propertyType = contentType.CompositionPropertyTypes.FirstOrDefault(x => x.Alias == key);
9293

9394
if (propertyType == null)
94-
throw new NullReferenceException($"No Property Type found with alias {key} on Content Type {contentType.Alias}");
95+
{
96+
LogHelper.Debug<NestedContentValueConnector>($"No Property Type found with alias {key} on Content Type {contentType.Alias}");
97+
continue;
98+
}
9599

96100
// throws if not found - no need for a null check
97101
var propValueConnector = ValueConnectors.Get(propertyType);
@@ -193,7 +197,10 @@ public void SetValue(IContentBase content, string alias, string value)
193197
var propertyType = contentType.CompositionPropertyTypes.FirstOrDefault(x => x.Alias == key);
194198

195199
if (propertyType == null)
196-
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+
}
197204

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

0 commit comments

Comments
 (0)