Skip to content

Commit

Permalink
hugolib: Change to output non-panic error message if missing shortcod…
Browse files Browse the repository at this point in the history
…e template

A panic occurred when the `nested` variable was nil.
Changed to check if the `nested` variable is nil.

Fixes #6075
  • Loading branch information
vazrupe authored and bep committed Aug 22, 2019
1 parent 3ae4b3e commit fd3d90c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hugolib/shortcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit fd3d90c

Please sign in to comment.