mirror of
https://github.com/taigrr/wails.git
synced 2026-04-02 05:08:54 -07:00
Fix potential nil conditions in webview
This commit is contained in:
@@ -353,7 +353,9 @@ func _webviewDispatchGoCallback(index unsafe.Pointer) {
|
||||
f = fns[uintptr(index)]
|
||||
delete(fns, uintptr(index))
|
||||
m.Unlock()
|
||||
f()
|
||||
if f != nil {
|
||||
f()
|
||||
}
|
||||
}
|
||||
|
||||
//export _webviewExternalInvokeCallback
|
||||
@@ -369,5 +371,7 @@ func _webviewExternalInvokeCallback(w unsafe.Pointer, data unsafe.Pointer) {
|
||||
}
|
||||
}
|
||||
m.Unlock()
|
||||
cb(wv, C.GoString((*C.char)(data)))
|
||||
if cb != nil {
|
||||
cb(wv, C.GoString((*C.char)(data)))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user