diff options
Diffstat (limited to 'tpl/tplimpl/templateFuncster.go')
-rw-r--r-- | tpl/tplimpl/templateFuncster.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tpl/tplimpl/templateFuncster.go b/tpl/tplimpl/templateFuncster.go index e6bbde8ec..9490123ab 100644 --- a/tpl/tplimpl/templateFuncster.go +++ b/tpl/tplimpl/templateFuncster.go @@ -51,12 +51,12 @@ func (t *templateFuncster) partial(name string, contextList ...interface{}) (int } for _, n := range []string{"partials/" + name, "theme/partials/" + name} { - templ := t.Tmpl.Lookup(n) - if templ == nil { + templ, found := t.Tmpl.Lookup(n) + if !found { // For legacy reasons. - templ = t.Tmpl.Lookup(n + ".html") + templ, found = t.Tmpl.Lookup(n + ".html") } - if templ != nil { + if found { b := bp.GetBuffer() defer bp.PutBuffer(b) @@ -64,7 +64,7 @@ func (t *templateFuncster) partial(name string, contextList ...interface{}) (int return "", err } - if _, ok := templ.Template.(*texttemplate.Template); ok { + if _, ok := templ.(*texttemplate.Template); ok { return b.String(), nil } |