mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-18 21:11:19 +02:00
Fix recently introduced new data race in the shortcode handling
Fixes #1599
This commit is contained in:
@@ -343,9 +343,14 @@ Loop:
|
|||||||
if tmpl == nil {
|
if tmpl == nil {
|
||||||
return sc, fmt.Errorf("Unable to locate template for shortcode '%s' in page %s", sc.name, p.BaseFileName())
|
return sc, fmt.Errorf("Unable to locate template for shortcode '%s' in page %s", sc.name, p.BaseFileName())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bep) Refactor/rename this lock strategy
|
||||||
|
isInnerShortcodeCache.Lock()
|
||||||
if tmpl.Tree == nil {
|
if tmpl.Tree == nil {
|
||||||
|
isInnerShortcodeCache.Unlock()
|
||||||
return sc, fmt.Errorf("Template for shortcode '%s' failed to compile for page '%s'", sc.name, p.BaseFileName())
|
return sc, fmt.Errorf("Template for shortcode '%s' failed to compile for page '%s'", sc.name, p.BaseFileName())
|
||||||
}
|
}
|
||||||
|
isInnerShortcodeCache.Unlock()
|
||||||
isInner = isInnerShortcode(tmpl)
|
isInner = isInnerShortcode(tmpl)
|
||||||
|
|
||||||
case tScParam:
|
case tScParam:
|
||||||
|
Reference in New Issue
Block a user