Skip to content

Commit b60f217

Browse files
Don't throw if a stored property value doesn't exist any more, it could have been removed
after the content was created, this is most likely not an error.
1 parent cd8e6bb commit b60f217

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

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

Lines changed: 5 additions & 1 deletion
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.Info<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);

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

Lines changed: 5 additions & 1 deletion
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.Info<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);

0 commit comments

Comments
 (0)