Skip to content

Commit

Permalink
hugolib: Fix error handling for JSON front matter
Browse files Browse the repository at this point in the history
Fixes #3610
  • Loading branch information
bep committed Jun 19, 2017
1 parent 662e12f commit fb53987
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions hugolib/page.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit fb53987

Please sign in to comment.