summaryrefslogtreecommitdiff
path: root/libgo/go/text/template/template.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/text/template/template.go')
-rw-r--r--libgo/go/text/template/template.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/libgo/go/text/template/template.go b/libgo/go/text/template/template.go
index 82fc9e5e39d..a2b9062ad14 100644
--- a/libgo/go/text/template/template.go
+++ b/libgo/go/text/template/template.go
@@ -117,6 +117,9 @@ func (t *Template) AddParseTree(name string, tree *parse.Tree) (*Template, error
// Templates returns a slice of the templates associated with t, including t
// itself.
func (t *Template) Templates() []*Template {
+ if t.common == nil {
+ return nil
+ }
// Return a slice so we don't expose the map.
m := make([]*Template, 0, len(t.tmpl))
for _, v := range t.tmpl {