Fix null dereference

This commit is contained in:
Aaron L 2017-01-24 23:04:59 -08:00
commit c02a2f0c20

View file

@ -195,7 +195,9 @@ func (o *{{$txt.LocalTable.NameGo}}) Set{{$txt.Function.Name}}(exec boil.Executo
{{if .ToJoinTable -}} {{if .ToJoinTable -}}
remove{{$txt.Function.Name}}From{{$txt.Function.ForeignName}}Slice(o, related) remove{{$txt.Function.Name}}From{{$txt.Function.ForeignName}}Slice(o, related)
o.R.{{$txt.Function.Name}} = nil if o.R != nil {
o.R.{{$txt.Function.Name}} = nil
}
{{else -}} {{else -}}
if o.R != nil { if o.R != nil {
for _, rel := range o.R.{{$txt.Function.Name}} { for _, rel := range o.R.{{$txt.Function.Name}} {