mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
hugolib: Fix potential server panic with drafts/future enabled
Fixes #4965
This commit is contained in:
parent
75acff5f20
commit
1ab4658c0d
1 changed files with 8 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue