diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-06-19 14:41:03 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-06-19 14:41:03 +0200 |
commit | fb53987a4ff2acb9da8dec6ec7b11924d37352ce (patch) | |
tree | 095f8c36a63ffc1ccbd831e3bc4b6055c32246e6 | |
parent | 662e12f348a638a6fcc92a416ee7f7c2a7ef8792 (diff) |
hugolib: Fix error handling for JSON front matter
Fixes #3610
-rw-r--r-- | hugolib/page.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/hugolib/page.go b/hugolib/page.go index d4aca37a4..cf0a2144c 100644 --- a/hugolib/page.go +++ b/hugolib/page.go @@ -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 } |