Skip to content

Commit adec159

Browse files
authored
Merge pull request #229 from umbraco/bugfix/zapier-polling-error
Fix dictionary duplicate key and multinode null reference.
2 parents b23f1e7 + 39575f8 commit adec159

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public string GetValue(IPublishedProperty contentProperty)
1717

1818
var items = contentProperty.GetValue() as IEnumerable<IPublishedContent>;
1919

20-
return items.Any()
20+
return items != null && items.Any()
2121
? string.Join(", ", items.Select(p => p.Name))
2222
: string.Empty;
2323
}

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

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

4242
var parser = _zapierContentFactory.Create(contentProperty.PropertyType.EditorAlias);
4343

44+
if (contentDict.ContainsKey(propertyType.Alias))
45+
{
46+
continue;
47+
}
48+
4449
contentDict.Add(propertyType.Alias, parser.GetValue(contentProperty));
4550
}
4651

@@ -58,6 +63,11 @@ public Dictionary<string, string> GetContentDictionary(IContent contentNode)
5863

5964
foreach (var prop in contentNode.Properties)
6065
{
66+
if (contentDict.ContainsKey(prop.Alias))
67+
{
68+
continue;
69+
}
70+
6171
contentDict.Add(prop.Alias, prop.Id == 0 || prop.Values.Count == 0 ? string.Empty : prop.GetValue().ToString());
6272
}
6373

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
@@ -9,7 +9,7 @@
99
<RepositoryUrl>https://github.com/umbraco/Umbraco.Cms.Integrations</RepositoryUrl>
1010
<PackageProjectUrl>https://github.com/umbraco/Umbraco.Cms.Integrations/blob/main/src/Umbraco.Cms.Integrations.Automation.Zapier</PackageProjectUrl>
1111
<Product>Umbraco.Cms.Integrations.Automation.Zapier</Product>
12-
<Version>1.3.0</Version>
12+
<Version>1.3.1</Version>
1313
<PackageTags>Umbraco;Umbraco-Marketplace</PackageTags>
1414
<PackageIcon>zapier.png</PackageIcon>
1515
<PackageReadmeFile>readme.md</PackageReadmeFile>

0 commit comments

Comments
 (0)