Fix panic in 404.Parent

Fixes #6924
This commit is contained in:
Bjørn Erik Pedersen
2020-02-21 08:06:38 +01:00
parent 6be6684cc5
commit 4c2a0de412
2 changed files with 9 additions and 4 deletions

View File

@@ -121,11 +121,13 @@ func (pt pageTree) Parent() page.Page {
return nil
}
if pt.p.Kind() == page.KindTaxonomyTerm {
tree := p.getTreeRef()
if pt.p.Kind() == page.KindTaxonomyTerm || tree == nil {
return pt.p.s.home
}
_, b := p.getTreeRef().getSection()
_, b := tree.getSection()
if b == nil {
return nil
}