diff options
author | Vazrupe (HyeonGyu Lee) <vazrupe@naver.com> | 2019-08-19 17:26:53 +0300 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-08-22 11:40:16 +0300 |
commit | fd3d90ced85baaf6941be45b2fe29c25ff755c18 (patch) | |
tree | dca0a5cfe2fa3ece6de50b023372c82ea9a3eda0 /hugolib | |
parent | 3ae4b3e19ff6be90d21b0cc38fa6ed37a83bd505 (diff) |
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
Diffstat (limited to 'hugolib')
-rw-r--r-- | hugolib/shortcode.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/hugolib/shortcode.go b/hugolib/shortcode.go index 895d0dcf2..8323962c0 100644 --- a/hugolib/shortcode.go +++ b/hugolib/shortcode.go @@ -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 { |