Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVazrupe (HyeonGyu Lee) <vazrupe@naver.com>2019-08-19 17:26:53 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-08-22 11:40:16 +0300
commitfd3d90ced85baaf6941be45b2fe29c25ff755c18 (patch)
treedca0a5cfe2fa3ece6de50b023372c82ea9a3eda0 /hugolib
parent3ae4b3e19ff6be90d21b0cc38fa6ed37a83bd505 (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.go3
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 {