Skip to content

Commit cf6aeb0

Browse files
authored
Merge pull request #230 from umbraco/bugfix/v14/zapier-polling-error
Fix dictionary duplicate key and multinode null reference.
2 parents fbe5b70 + 37f420d commit cf6aeb0

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

src/Umbraco.Cms.Integrations.Automation.Zapier/Services/Parsers/MultiNodeTreePickerParser.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System.Collections.Generic;
2-
using System.Linq;
3-
using Umbraco.Cms.Core.Models.PublishedContent;
1+
using Umbraco.Cms.Core.Models.PublishedContent;
42

53
namespace Umbraco.Cms.Integrations.Automation.Zapier.Services.Parsers
64
{
@@ -12,7 +10,7 @@ public string GetValue(IPublishedProperty contentProperty)
1210

1311
var items = contentProperty.GetValue() as IEnumerable<IPublishedContent>;
1412

15-
return items.Any()
13+
return items != null && items.Any()
1614
? string.Join(", ", items.Select(p => p.Name))
1715
: string.Empty;
1816
}

src/Umbraco.Cms.Integrations.Automation.Zapier/Services/ZapierContentService.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ public Dictionary<string, string> GetContentTypeDictionary(IContentType contentT
3131

3232
var parser = _zapierContentFactory.Create(contentProperty.PropertyType.EditorAlias);
3333

34+
if (contentDict.ContainsKey(propertyType.Alias))
35+
{
36+
continue;
37+
}
38+
3439
contentDict.Add(propertyType.Alias, parser.GetValue(contentProperty));
3540
}
3641

@@ -48,6 +53,11 @@ public Dictionary<string, string> GetContentDictionary(IContent contentNode)
4853

4954
foreach (var prop in contentNode.Properties)
5055
{
56+
if (contentDict.ContainsKey(prop.Alias))
57+
{
58+
continue;
59+
}
60+
5161
contentDict.Add(prop.Alias, prop.Id == 0 || prop.Values.Count == 0 ? string.Empty : prop.GetValue().ToString());
5262
}
5363

src/Umbraco.Cms.Integrations.Automation.Zapier/Umbraco.Cms.Integrations.Automation.Zapier.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<RepositoryUrl>https://github.com/umbraco/Umbraco.Cms.Integrations</RepositoryUrl>
1818
<PackageProjectUrl>https://github.com/umbraco/Umbraco.Cms.Integrations/blob/main/src/Umbraco.Cms.Integrations.Automation.Zapier</PackageProjectUrl>
1919
<Product>Umbraco.Cms.Integrations.Automation.Zapier</Product>
20-
<Version>2.0.0</Version>
20+
<Version>2.0.1</Version>
2121
<PackageTags>Umbraco;Umbraco-Marketplace</PackageTags>
2222
<PackageIcon>zapier.png</PackageIcon>
2323
<PackageReadmeFile>readme.md</PackageReadmeFile>

0 commit comments

Comments
 (0)