diff --git a/layouts/taxonomy/category.terms.html b/layouts/taxonomy/category.terms.html
index 546bc19..d7869ca 100644
--- a/layouts/taxonomy/category.terms.html
+++ b/layouts/taxonomy/category.terms.html
@@ -9,8 +9,10 @@
{{ $parentCategories := slice }}
{{ range $allPages }}
- {{ if gt (len .Params.categories) 0 }}
- {{ $parentCategories = $parentCategories | append (index .Params.categories 0) }}
+ {{ if isset .Params "categories" }}
+ {{ if gt (len .Params.categories) 0 }}
+ {{ $parentCategories = $parentCategories | append (index .Params.categories 0) }}
+ {{ end }}
{{ end }}
{{ end }}
{{ $parentCategories = $parentCategories | uniq | sort }}
@@ -23,11 +25,13 @@
{{ range $allPages }}
- {{ if gt (len .Params.categories) 0 }}
- {{ if eq (index .Params.categories 0) $parentName }}
- {{ $parentPages = $parentPages | append . }}
- {{ if gt (len .Params.categories) 1 }}
- {{ $subcategories = $subcategories | append (index .Params.categories 1) }}
+ {{ if isset .Params "categories" }}
+ {{ if gt (len .Params.categories) 0 }}
+ {{ if eq (index .Params.categories 0) $parentName }}
+ {{ $parentPages = $parentPages | append . }}
+ {{ if gt (len .Params.categories) 1 }}
+ {{ $subcategories = $subcategories | append (index .Params.categories 1) }}
+ {{ end }}
{{ end }}
{{ end }}
{{ end }}