Skip to content

Commit 9f27234

Browse files
committed
Content Type query null check
1 parent 63dedaf commit 9f27234

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Umbraco.Cms.Integrations.Automation.Zapier/Controllers/PollingController.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ public IEnumerable<PublishedContentDto> GetSampleContent()
4646
{
4747
if (!IsUserValid()) return null;
4848

49-
var rootNodes = _contentService.GetRootContent().Where(p => p.Published)
50-
.OrderByDescending(p => p.PublishDate);
49+
var rootNodes = _contentService.GetRootContent()
50+
.Where(p => p.Published)
51+
.OrderByDescending(p => p.PublishDate);
5152

5253
return rootNodes.Select(p => new PublishedContentDto
5354
{
@@ -62,6 +63,7 @@ public List<Dictionary<string, string>> GetContentByType(string alias)
6263
if (!IsUserValid()) return null;
6364

6465
var contentType = _contentTypeService.Get(alias);
66+
if (contentType == null) return new List<Dictionary<string, string>>();
6567

6668
return new List<Dictionary<string, string>> { contentType.ToContentTypeDictionary() };
6769
}

0 commit comments

Comments
 (0)