mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 04:59:38 +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
|
||||
result = reflect.ValueOf(val).Convert(typ)
|
||||
|
||||
// Translate javascript null values
|
||||
if val == nil {
|
||||
result = reflect.Zero(typ)
|
||||
} else {
|
||||
result = reflect.ValueOf(val).Convert(typ)
|
||||
}
|
||||
return result, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user