Fix nil pointer dereference

This commit is contained in:
Andinus 2025-01-09 21:42:22 +05:30
parent f0b9ab0d63
commit b82d9089bd
Signed by: andinus
SSH Key Fingerprint: SHA256:rop/w9c/gwtEJhUWS5curN3KJEwRr+Fm1ojM3liQTqo

@ -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)
}