tpl: Fix nil pointer in Tree()
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 5 Apr 2017 20:11:24 +0000 (22:11 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 5 Apr 2017 20:12:03 +0000 (22:12 +0200)
Fixes #3285

tpl/template.go

index 617aa84ecbe54e5cea542dd6c008b7668910f740..356d66f1e897b4d0f4fa9a2e287d104703101b6b 100644 (file)
@@ -88,7 +88,7 @@ func (t *TemplateAdapter) Tree() string {
                panic("Unknown template")
        }
 
-       if tree.Root == nil {
+       if tree == nil || tree.Root == nil {
                return ""
        }
        s := tree.Root.String()