From 7d3dfba84b52ce8f33cc77380e3cc4c586a35201 Mon Sep 17 00:00:00 2001 From: Mathias Biilmann Date: Sun, 11 Sep 2016 10:46:56 +0200 Subject: [PATCH] Prevent panic on empty authorlist --- hugolib/page.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hugolib/page.go b/hugolib/page.go index 7892f222d..bc54aac91 100644 --- 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{} }