diff --git a/permission_handler_windows/CHANGELOG.md b/permission_handler_windows/CHANGELOG.md index 91c2f5049..88a17aa4e 100644 --- a/permission_handler_windows/CHANGELOG.md +++ b/permission_handler_windows/CHANGELOG.md @@ -1,3 +1,6 @@ +## 0.2.2 +* Fixed crashing issue on early windows 10 machines (https://github.com/Baseflow/flutter-permission-handler/issues/1388) + ## 0.2.1 * Updates the dependency on `permission_handler_platform_interface` to version 4.1.0 (SiriKit support is only available for iOS and macOS). diff --git a/permission_handler_windows/pubspec.yaml b/permission_handler_windows/pubspec.yaml index f5553e0d6..3495a07b7 100644 --- a/permission_handler_windows/pubspec.yaml +++ b/permission_handler_windows/pubspec.yaml @@ -1,6 +1,6 @@ name: permission_handler_windows description: Permission plugin for Flutter. This plugin provides the Windows API to request and check permissions. -version: 0.2.1 +version: 0.2.2 homepage: https://github.com/baseflow/flutter-permission-handler flutter: diff --git a/permission_handler_windows/windows/permission_handler_windows_plugin.cpp b/permission_handler_windows/windows/permission_handler_windows_plugin.cpp index 4b4d6d184..dc6842b49 100644 --- a/permission_handler_windows/windows/permission_handler_windows_plugin.cpp +++ b/permission_handler_windows/windows/permission_handler_windows_plugin.cpp @@ -87,10 +87,14 @@ void PermissionHandlerWindowsPlugin::RegisterWithRegistrar( } PermissionHandlerWindowsPlugin::PermissionHandlerWindowsPlugin(){ - m_positionChangedRevoker = geolocator.PositionChanged(winrt::auto_revoke, - [this](Geolocator const& geolocator, PositionChangedEventArgs e) - { - }); + try { + m_positionChangedRevoker = geolocator.PositionChanged(winrt::auto_revoke, + [this](Geolocator const& geolocator, PositionChangedEventArgs e) + { + }); + } catch (...) { + /* Do nothing */ + } } PermissionHandlerWindowsPlugin::~PermissionHandlerWindowsPlugin() = default; @@ -187,7 +191,11 @@ winrt::fire_and_forget PermissionHandlerWindowsPlugin::IsBluetoothServiceEnabled void PermissionHandlerWindowsPluginRegisterWithRegistrar( FlutterDesktopPluginRegistrarRef registrar) { - PermissionHandlerWindowsPlugin::RegisterWithRegistrar( + try { + PermissionHandlerWindowsPlugin::RegisterWithRegistrar( PluginRegistrarManager::GetInstance() ->GetRegistrar(registrar)); + } catch (...) { + /* Do nothing */ + } }