In Hugo 0.42, this could lead to errors of type `runtime error: invalid memory address or nil pointer dereference` in some rare situations.
Note that this was also an issue before 0.42, but the symptom was then potentially stale list content on rebuilds on content changes.
This commit also improves the above error message.
Fixes #4845
}
func (p *Page) Render(layout ...string) template.HTML {
+ if p.mainPageOutput == nil {
+ panic(fmt.Sprintf("programming error: no mainPageOutput for %q", p.Path()))
+ }
return p.mainPageOutput.Render(layout...)
}
s.expiredCount = 0
+ spc = newPageCache()
+
for _, p := range s.rawAllPages {
p.subSections = Pages{}
p.parent = nil