diff --git a/template_nest.go b/template_nest.go index aeafb5d..9037d88 100644 --- a/template_nest.go +++ b/template_nest.go @@ -279,6 +279,10 @@ func (nest *TemplateNest) MustRender(toRender interface{}) string { } func (nest *TemplateNest) Render(toRender interface{}) (string, error) { + if toRender == nil { + return "", nil + } + if reflect.TypeOf(toRender).Kind() == reflect.Slice { return nest.renderSlice(toRender) }