Skip to content

Commit 375400c

Browse files
ihor-biletskyiJohanPetersson
authored andcommitted
Handle error in the PageListBlockViewComponent when PageListBlock.Root references to the deleted page
1 parent 2b4c1d3 commit 375400c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

templates/Alloy.Mvc/Components/PageListBlockViewComponent.cs

+5
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ private IEnumerable<PageData> FindPages(PageListBlock currentBlock)
4545
IEnumerable<PageData> pages;
4646
var listRoot = currentBlock.Root;
4747

48+
if (ContentReference.IsNullOrEmpty(listRoot))
49+
{
50+
return Enumerable.Empty<PageData>();
51+
}
52+
4853
if (currentBlock.Recursive)
4954
{
5055
if (currentBlock.PageTypeFilter is not null)

0 commit comments

Comments
 (0)