helper/schema: zero value set should set function [GH-1009]
This commit is contained in:
parent
f4408f2e63
commit
0bc0c03fec
|
@ -42,8 +42,8 @@ func (r *FieldReadResult) ValueOrZero(s *Schema) interface{} {
|
|||
|
||||
// The zero value of a set is nil, but we want it
|
||||
// to actually be an empty set object...
|
||||
if s.Type == TypeSet && result == nil {
|
||||
result = &Set{F: s.Set}
|
||||
if set, ok := result.(*Set); ok && set.F == nil {
|
||||
set.F = s.Set
|
||||
}
|
||||
|
||||
return result
|
||||
|
|
Loading…
Reference in New Issue