mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-15 20:44:01 +02:00
hugolib: Fix potential server panic with drafts/future enabled
Fixes #4965
This commit is contained in:
@@ -1511,12 +1511,19 @@ func (s *Site) resetBuildState() {
|
||||
|
||||
spc = newPageCache()
|
||||
|
||||
for _, p := range s.rawAllPages {
|
||||
initPage := func(p *Page) {
|
||||
p.subSections = Pages{}
|
||||
p.parent = nil
|
||||
p.scratch = maps.NewScratch()
|
||||
p.mainPageOutput = nil
|
||||
}
|
||||
|
||||
for _, p := range s.Pages {
|
||||
initPage(p)
|
||||
}
|
||||
for _, p := range s.headlessPages {
|
||||
initPage(p)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Site) kindFromSections(sections []string) string {
|
||||
|
Reference in New Issue
Block a user