mirror of
https://github.com/gohugoio/hugo.git
synced 2024-05-11 05:54:58 +00:00
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.
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
e59aabcf46
commit
05c29ad593
@ -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:
|
||||
|
Reference in New Issue
Block a user