Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions v3/UNRELEASED_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ After processing, the content will be moved to the main changelog and this file

## Fixed
<!-- Bug fixes -->
- Windows: a failed or nil `GetRequest` in the WebResourceRequested handler no longer kills the process (`log.Fatal` / nil-dereference panic) — the request is dropped and logged instead in [PR](https://github.com/wailsapp/wails/pull/6006) by @midagedev

## Deprecated
<!-- Soon-to-be removed features -->
Expand Down
11 changes: 9 additions & 2 deletions v3/internal/webview2/pkg/edge/chromium.go
Original file line number Diff line number Diff line change
Expand Up @@ -723,8 +723,15 @@ func (e *Chromium) PermissionRequested(_ *ICoreWebView2, args *iCoreWebView2Perm

func (e *Chromium) WebResourceRequested(sender *ICoreWebView2, args *ICoreWebView2WebResourceRequestedEventArgs) uintptr {
req, err := args.GetRequest()
if err != nil {
log.Fatal(err)
if err != nil || req == nil {
// COM can fail here under load without setting the out pointer
// (#1103). Dropping one request is recoverable (the WebView falls
// back to default handling for it); killing the process is not.
if err == nil {
err = errors.New("no error, but the request out pointer was not set (#1103)")
}
log.Printf("[WebView2] WebResourceRequested failed to get request: %v", err)
return 0
Comment thread
coderabbitai[bot] marked this conversation as resolved.
}
defer req.Release()

Expand Down
Loading