mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-26 03:21:52 +00:00
Prevent panic on empty authorlist
This commit is contained in:
parent
3392133128
commit
7d3dfba84b
1 changed files with 4 additions and 1 deletions
|
@ -193,8 +193,11 @@ func (p *Page) Author() Author {
|
|||
|
||||
func (p *Page) Authors() AuthorList {
|
||||
authorKeys, ok := p.Params["authors"]
|
||||
if !ok {
|
||||
return AuthorList{}
|
||||
}
|
||||
authors := authorKeys.([]string)
|
||||
if !ok || len(authors) < 1 || len(p.Site.Authors) < 1 {
|
||||
if len(authors) < 1 || len(p.Site.Authors) < 1 {
|
||||
return AuthorList{}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue