diff --git a/layouts/partials/section-index.html b/layouts/partials/section-index.html
index 845d5c614..0ce414e74 100644
--- a/layouts/partials/section-index.html
+++ b/layouts/partials/section-index.html
@@ -4,7 +4,8 @@
{{ $pages = (where $pages "Type" "!=" "search") }}
{{ $pages = (where $pages ".Params.hide_summary" "!=" true) -}}
{{ $pages = (where $pages ".Parent" "!=" nil) -}}
- {{ if and .Parent .Parent.File -}}
+ {{ $pages = (where $pages ".Parent.File" "!=" nil) -}}
+ {{ if and $parent $parent.File -}}
{{ $pages = (where $pages "Parent.File.UniqueID" "==" $parent.File.UniqueID) -}}
{{ end -}}
{{ if or $parent.Params.no_list (eq (len $pages) 0) -}}