Permalink
Browse files

hugolib: Fix error handling for JSON front matter

Fixes #3610
  • Loading branch information...
bep committed Jun 19, 2017
1 parent 662e12f commit fb53987a4ff2acb9da8dec6ec7b11924d37352ce
Showing with 4 additions and 3 deletions.
  1. +4 −3 hugolib/page.go
View
@@ -1318,10 +1318,11 @@ func (p *Page) parse(reader io.Reader) error {
p.lang = p.Source.File.Lang()
meta, err := psr.Metadata()
if err != nil {
return fmt.Errorf("failed to parse page metadata for %q: %s", p.File.Path(), err)
}
if meta != nil {
if err != nil {
return fmt.Errorf("failed to parse page metadata for %s: %s", p.File.Path(), err)
}
if err = p.update(meta); err != nil {
return err
}

0 comments on commit fb53987

Please sign in to comment.