Skip to content
Closed
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
[webview_flutter] fix: Fixed handling of null authentication challeng…
…e responses to follow WKWebView's default behavior, When no authentication challenge handler is implemented in Flutter, return the default WKWebView cancel response instead of throwing an error. This makes the behavior more idiomatic and prevents crashes

When no authentication challenge handler is implemented in Flutter,
return the default WKWebView cancel response instead of throwing an error.

Fixes flutter/flutter#163213
  • Loading branch information
msamoeed committed Feb 13, 2025
commit 84d2cc20f38705c778e01fd7d9b50c9eeec63578
Original file line number Diff line number Diff line change
Expand Up @@ -4344,7 +4344,7 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate
let message: String? = nilOrValue(listResponse[1])
let details: String? = nilOrValue(listResponse[2])
completion(.failure(PigeonError(code: code, message: message, details: details)))
} else if listResponse[0] == nil {
} else if listResponse[0] == nil || firstElement is NSNull {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also for reference in case you plan to contribute to webview_flutter in the future: Per the comment at the top of this file, it cannot be edited like this.

// Autogenerated from Pigeon (v22.7.2), do not edit directly.

completion(
.failure(
PigeonError(
Expand Down