diff options
author | Cameron Moore <moorereason@gmail.com> | 2015-11-15 13:53:12 -0600 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2015-11-20 23:34:30 +0100 |
commit | 05c29ad593b8e004c901fdca1f1b75864c1ac91a (patch) | |
tree | e8162c10d0310085130b6b4c74fa245274ae29eb /hugolib | |
parent | e59aabcf4615b28e3c4224d7a9bbbc1a3091a69c (diff) |
Return error if shortcode template.Tree is nil
If a shortcode template fails to compile, the template will be non-nil, but
template.Tree will be nil which caused a panic.
Diffstat (limited to 'hugolib')
-rw-r--r-- | hugolib/shortcode.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/hugolib/shortcode.go b/hugolib/shortcode.go index 5fb9b7cc8..e65a85989 100644 --- a/hugolib/shortcode.go +++ b/hugolib/shortcode.go @@ -343,6 +343,9 @@ Loop: if tmpl == nil { return sc, fmt.Errorf("Unable to locate template for shortcode '%s' in page %s", sc.name, p.BaseFileName()) } + if tmpl.Tree == nil { + return sc, fmt.Errorf("Template for shortcode '%s' failed to compile for page '%s'", sc.name, p.BaseFileName()) + } isInner = isInnerShortcode(tmpl) case tScParam: |