shithub: hugo

Download patch

ref: 6650fae7ad1e83b54f0e171113f19008585347ef
parent: b31da911b50dd2f2942e25df820cd724bcffd8ac
author: Bjørn Erik Pedersen <[email protected]>
date: Wed Apr 5 18:11:24 EDT 2017

tpl: Fix nil pointer in Tree()

Fixes #3285

--- a/tpl/template.go
+++ b/tpl/template.go
@@ -88,7 +88,7 @@
 		panic("Unknown template")
 	}
 
-	if tree.Root == nil {
+	if tree == nil || tree.Root == nil {
 		return ""
 	}
 	s := tree.Root.String()