Is there an existing issue for this?
Current Behavior
On Windows, the application crashes when a website requests an unsupported WebView2 permission resource.
The crash occurs in PermissionRequest.fromMap with the following exception:
Null check operator used on a null value
This happens because PermissionResourceType.fromNativeValue(...) returns null for unknown permission resource IDs (e.g. resource ID 13 from https://web.whatsapp.com/), and the result is force-unwrapped.
Expected Behavior
Unknown WebView2 permission resource IDs should be handled gracefully instead of causing a crash.
If a permission resource is not recognized, it should be ignored or filtered out, allowing the WebView to continue running normally.
Steps with code example to reproduce
-
Create an InAppWebView on Windows.
-
Load the following URL:
InAppWebView(
initialUrlRequest: URLRequest(
url: WebUri(" https://web.whatsapp.com/"),
),
)
-
Wait until the website requests a permission.
-
The application crashes with:
Null check operator used on a null value
PermissionRequest.fromMap
Stacktrace/Logs
Stacktrace/Logs
[WindowsInAppWebViewController] (windows) WebView ID 1702660057664 calling "onProgressChanged" using {progress: 100}
[WindowsInAppWebViewController] (windows) WebView ID 1702660057664 calling "onLoadStop" using {url: https://web.whatsapp.com/}
Permission: [] from https://web.whatsapp.com/
[WindowsInAppWebViewController] (windows) WebView ID 1702660057664 calling "onPermissionRequest" using {origin: https://web.whatsapp.com/, resources: [13]}
[WindowsInAppWebViewController] (windows) WebView ID 1702660057664 calling "onTitleChanged" using {title: WhatsApp}
[ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: ProcessException: The system cannot find the file specified (at ../../../flutter/third_party/dart/runtime/bin/process_win.cc:577)
Flutter version
3.44.0
Operating System, Device-specific and/or Tool
Windows
Plugin version
6.1.5
Additional information
No response
Self grab
Is there an existing issue for this?
Current Behavior
On Windows, the application crashes when a website requests an unsupported WebView2 permission resource.
The crash occurs in
PermissionRequest.fromMapwith the following exception:Null check operator used on a null value
This happens because
PermissionResourceType.fromNativeValue(...)returns null for unknown permission resource IDs (e.g. resource ID 13 from https://web.whatsapp.com/), and the result is force-unwrapped.Expected Behavior
Unknown WebView2 permission resource IDs should be handled gracefully instead of causing a crash.
If a permission resource is not recognized, it should be ignored or filtered out, allowing the WebView to continue running normally.
Steps with code example to reproduce
Create an
InAppWebViewon Windows.Load the following URL:
Wait until the website requests a permission.
The application crashes with:
Stacktrace/Logs
Stacktrace/Logs
Flutter version
3.44.0
Operating System, Device-specific and/or Tool
Windows
Plugin version
6.1.5
Additional information
No response
Self grab