Fix nil pointer dereference
This commit is contained in:
parent
f0b9ab0d63
commit
b82d9089bd
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user