Skip to content

Commit

Permalink
fix: prevent panic when use pg array with custom database type
Browse files Browse the repository at this point in the history
  • Loading branch information
ImSingee authored Nov 29, 2022
1 parent 08876b4 commit 67e4412
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions internal/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ func MakeSliceNextElemFunc(v reflect.Value) func() reflect.Value {
if elem.IsNil() {
elem.Set(reflect.New(elemType))
}
return elem.Elem()
return elem
}

elem := reflect.New(elemType)
v.Set(reflect.Append(v, elem))
return elem.Elem()
return elem
}
}

Expand Down
4 changes: 2 additions & 2 deletions util.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ func makeSliceNextElemFunc(v reflect.Value) func() reflect.Value {
if elem.IsNil() {
elem.Set(reflect.New(elemType))
}
return elem.Elem()
return elem
}

elem := reflect.New(elemType)
v.Set(reflect.Append(v, elem))
return elem.Elem()
return elem
}
}

Expand Down

0 comments on commit 67e4412

Please sign in to comment.