mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-27 21:02:11 +00:00
hugolib: Change to output non-panic error message if missing shortcode template
A panic occurred when the `nested` variable was nil. Changed to check if the `nested` variable is nil. Fixes #6075
This commit is contained in:
parent
3ae4b3e19f
commit
fd3d90ced8
1 changed files with 2 additions and 1 deletions
|
@ -473,9 +473,10 @@ Loop:
|
|||
pt.Backup()
|
||||
nested, err := s.extractShortcode(nestedOrdinal, nextLevel, pt)
|
||||
nestedOrdinal++
|
||||
if nested.name != "" {
|
||||
if nested != nil && nested.name != "" {
|
||||
s.nameSet[nested.name] = true
|
||||
}
|
||||
|
||||
if err == nil {
|
||||
sc.inner = append(sc.inner, nested)
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue