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:
Vazrupe (HyeonGyu Lee) 2019-08-19 23:26:53 +09:00 committed by Bjørn Erik Pedersen
parent 3ae4b3e19f
commit fd3d90ced8
1 changed files with 2 additions and 1 deletions

View File

@ -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 {