hugo

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

git clone git://git.shimmy1996.com/hugo.git
commit 804603155f775bbf1b03dbeadbb78f978af6c169
parent 75cf324322fafe9f2b3f92de369752f413886353
Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Date:   Sat, 27 Feb 2016 23:25:41 +0100

Check for the presence of pages before setting dates

See #1903

Diffstat:
Mhugolib/site.go | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/hugolib/site.go b/hugolib/site.go
@@ -1711,8 +1711,10 @@ func (s *Site) newHomeNode() *Node {
 	n.IsHome = true
 	s.setURLs(n, "/")
 	n.Data["Pages"] = s.Pages
-	n.Date = s.Pages[0].Date
-	n.Lastmod = s.Pages[0].Lastmod
+	if len(s.Pages) != 0 {
+		n.Date = s.Pages[0].Date
+		n.Lastmod = s.Pages[0].Lastmod
+	}
 	return n
 }