mirror of
https://github.com/gohugoio/hugo.git
synced 2025-01-24 23:10:42 +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:
parent
e59aabcf46
commit
05c29ad593
1 changed files with 3 additions and 0 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue