Fix recently introduced new data race in the shortcode handling

Fixes #1599
This commit is contained in:
Bjørn Erik Pedersen 2015-11-21 20:03:18 +01:00
parent 5c7234015d
commit 58c446f562

View file

@ -343,9 +343,14 @@ Loop:
if tmpl == nil {
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 {
isInnerShortcodeCache.Unlock()
return sc, fmt.Errorf("Template for shortcode '%s' failed to compile for page '%s'", sc.name, p.BaseFileName())
}
isInnerShortcodeCache.Unlock()
isInner = isInnerShortcode(tmpl)
case tScParam: