diff --git a/hugolib/site_sections.go b/hugolib/site_sections.go index d27b31614..abcac1d5c 100644 --- a/hugolib/site_sections.go +++ b/hugolib/site_sections.go @@ -152,6 +152,8 @@ func unwrapPage(in interface{}) (*Page, error) { return v.Page, nil case *PageWithoutContent: return v.Page, nil + case nil: + return nil, nil default: return nil, fmt.Errorf("%T not supported", in) } diff --git a/hugolib/site_sections_test.go b/hugolib/site_sections_test.go index 86ae4080c..24bb6a91f 100644 --- a/hugolib/site_sections_test.go +++ b/hugolib/site_sections_test.go @@ -166,6 +166,11 @@ PAG|{{ .Title }}|{{ $sect.InSection . }} assert.Equal("empty3.md", b.Pages[0].File.LogicalName()) }}, + {"empty3", func(p *Page) { + xxx := p.s.getPage(KindPage, "empty3", "nil") + assert.Nil(xxx) + assert.Equal(xxx.Eq(nil), true) + }}, {"top", func(p *Page) { assert.Equal("Tops", p.title) assert.Len(p.Pages, 2)