diff --git a/pages/page.go b/pages/page.go index b17849230c..6691d82d0a 100644 --- a/pages/page.go +++ b/pages/page.go @@ -212,7 +212,9 @@ func (pg *Page) Init() { for u, p := range pg.URLToPagePath { if p == needsPath { delete(pg.URLToPagePath, u) - w.FindPath(u).AsTree().Delete() + if n := w.FindPath(u); n != nil { + n.AsTree().Delete() + } } } // open the default page if there is no currently open page