Check for the presence of pages before setting dates

See #1903
This commit is contained in:
Bjørn Erik Pedersen 2016-02-27 23:25:41 +01:00
parent 75cf324322
commit 804603155f

View file

@ -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
}