hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit 7d3dfba84b52ce8f33cc77380e3cc4c586a35201
parent 3392133128da4f23df3ebcfb52e2ebbf827e714f
Author: Mathias Biilmann <info@mathias-biilmann.net>
Date:   Sun, 11 Sep 2016 10:46:56 +0200

Prevent panic on empty authorlist


Diffstat:
Mhugolib/page.go | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/hugolib/page.go b/hugolib/page.go
@@ -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{}
 	}