Please check the following before submitting a new issue.
Please select affected platform(s)
Steps to reproduce
Found during code review. At
|
|| methodName.compare("openAppSettings")) { |
the second operand of the || is written as
methodName.compare("openAppSettings") without
== 0.
Expected results
The user-visible effect is that calling openAppSettings() on Windows throws a MissingPluginException on the Dart side rather than returning a value — so apps that offer an "open settings" action after a permanent denial hit an exception on Windows — and, conversely, genuinely unsupported methods silently succeed with false instead of reporting NotImplemented, hiding real gaps from callers.
Actual results
Since std::string::compare returns 0 on a match, that expression is false precisely when the method is openAppSettings and true for every other name, which swaps the two arms of the condition: openAppSettings is the only method that falls through to result->NotImplemented(), while every unrecognized method name is instead handled and returns Success(false).
Code sample
It's an obvious logic typo, found during code review. Observed in permission_handler_windows 0.2.2, pulled in transitively by permission_handler 13.0.2.
Adding == 0 to line 144 restores both behaviors.
Screenshots or video
No response
Version
13.0.2
Flutter Doctor output
Doctor output
$ flutter doctor -v
[√] Flutter (Channel stable, 3.47.2, on Microsoft Windows [Version 10.0.26200.9445], locale en-US) [421ms]
• Flutter version 3.47.2 on channel stable at C:\ProgramData\flutter\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision d3b14c8769 (2 weeks ago), 2026-08-26 16:07:51 -0700
• Engine revision a804b26164
• Dart version 3.13.2
• DevTools version 2.60.0
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets,
enable-record-use, enable-swift-package-manager, omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration
[√] Windows Version (Windows 11 or higher, 25H2, 2009) [1,781ms]
[!] Android toolchain - develop for Android devices (Android SDK version 37.0.0) [618ms]
• Android SDK at C:\Users\dale\AppData\Local\Android\sdk
• Emulator version 37.1.11.0 (build_id 15917651) (CL:N/A)
• Platform android-37.0, build-tools 37.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 25.0.3+-15898627-b508.16)
X Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/to/windows-android-setup for more details.
[√] Chrome - develop for the web [106ms]
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.14.40) [105ms]
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.14.37628.2
• Windows 10 SDK version 10.0.26100.0
[√] Connected device (4 available) [628ms]
• sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 13 (API 33) (emulator)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.26200.9445]
• Chrome (web) • chrome • web-javascript • Google Chrome 153.0.8010.37
• Edge (web) • edge • web-javascript • Microsoft Edge 150.0.4078.83
[√] Network resources [756ms]
• All expected network resources are available.
! Doctor found issues in 1 category.
Please check the following before submitting a new issue.
Please select affected platform(s)
Steps to reproduce
Found during code review. At
flutter-permission-handler/permission_handler_windows/windows/permission_handler_windows_plugin.cpp
Line 144 in fc60b52
methodName.compare("openAppSettings")without== 0.Expected results
The user-visible effect is that calling openAppSettings() on Windows throws a MissingPluginException on the Dart side rather than returning a value — so apps that offer an "open settings" action after a permanent denial hit an exception on Windows — and, conversely, genuinely unsupported methods silently succeed with false instead of reporting NotImplemented, hiding real gaps from callers.
Actual results
Since std::string::compare returns 0 on a match, that expression is false precisely when the method is openAppSettings and true for every other name, which swaps the two arms of the condition: openAppSettings is the only method that falls through to result->NotImplemented(), while every unrecognized method name is instead handled and returns Success(false).
Code sample
It's an obvious logic typo, found during code review. Observed in permission_handler_windows 0.2.2, pulled in transitively by permission_handler 13.0.2.
Adding
== 0to line 144 restores both behaviors.Screenshots or video
No response
Version
13.0.2
Flutter Doctor output
Doctor output