Adds checks for zero length arrays.
Assigning values from nil or zero length elements or dimensions now return immediately as there are no values to assign.
This commit is contained in:
@@ -192,6 +192,10 @@ func (dst Float8Array) Get() interface{} {
|
||||
func (src *Float8Array) AssignTo(dst interface{}) error {
|
||||
switch src.Status {
|
||||
case Present:
|
||||
if len(src.Elements) == 0 || len(src.Dimensions) == 0 {
|
||||
// No values to assign
|
||||
return nil
|
||||
}
|
||||
if len(src.Dimensions) <= 1 {
|
||||
// Attempt to match to select common types:
|
||||
switch v := dst.(type) {
|
||||
|
||||
Reference in New Issue
Block a user