mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 06:50:22 +08:00
fix: convert js nulls to Go zero values
This commit is contained in:
parent
74dbbbed8a
commit
c5276cca6c
@ -153,8 +153,11 @@ func (b *boundFunction) setInputValue(index int, typ reflect.Type, val interface
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
// Do the conversion
|
// Translate javascript null values
|
||||||
|
if val == nil {
|
||||||
|
result = reflect.Zero(typ)
|
||||||
|
} else {
|
||||||
result = reflect.ValueOf(val).Convert(typ)
|
result = reflect.ValueOf(val).Convert(typ)
|
||||||
|
}
|
||||||
return result, err
|
return result, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user