mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 14:45:49 +01:00
fix: convert js nulls to Go zero values
This commit is contained in:
parent
74dbbbed8a
commit
c5276cca6c
1 changed files with 6 additions and 3 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue