-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[image_picker] Fix crash due to SecurityException
#4004
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm with nit
// `SecurityException` on some devices in certain circumstances. Instead of crashing, we | ||
// return `null`. | ||
// | ||
// See [this issue](https://github.com/flutter/flutter/issues/100025) for more details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: the markdown formatting here won't do anything useful (as far as I know), I would just omit the [this issue]
and the parens
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (minus outstanding previous nit pointed out by @tarrinneal), thanks for the fix!
6dd1794
to
c701668
Compare
@JeroenWeener if you can merge main, we can land this today. |
c701668
to
44afbb4
Compare
flutter/packages@1e214d7...83959fb 2023-05-22 [email protected] [in_app_purchases] Fix mismatching method signature strings (flutter/packages#4040) 2023-05-22 [email protected] [go_router] Nested stateful navigation with ShellRoute (flutter/packages#2650) 2023-05-22 [email protected] [go_router] Nested stateful navigation with ShellRoute (flutter/packages#2650) 2023-05-22 [email protected] [go_router] Nested stateful navigation with ShellRoute (flutter/packages#2650) 2023-05-22 [email protected] Roll Flutter from 077d644 to ab57304 (18 revisions) (flutter/packages#4051) 2023-05-19 [email protected] Roll Flutter from 5ae6438 to 077d644 (23 revisions) (flutter/packages#4043) 2023-05-19 [email protected] [local_auth] Migrate iOS to Pigeon (flutter/packages#3974) 2023-05-19 [email protected] [go_router] fix context extension for replaceNamed (flutter/packages#3927) 2023-05-19 [email protected] [image_picker] Fix crash due to `SecurityException` (flutter/packages#4004) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
* main: (104 commits) [various] Remove unnecessary null checks (flutter#4060) [ci] Add a legacy Android build-all test (flutter#4005) Roll Flutter from ab57304 to 3437189 (5 revisions) (flutter#4062) [go_router] Nested stateful navigation with ShellRoute (flutter#2650) [go_router] Nested stateful navigation with ShellRoute (flutter#2650) [go_router] Nested stateful navigation with ShellRoute (flutter#2650) [in_app_purchases] Fix mismatching method signature strings (flutter#4040) [go_router] Nested stateful navigation with ShellRoute (flutter#2650) [go_router] Nested stateful navigation with ShellRoute (flutter#2650) [go_router] Nested stateful navigation with ShellRoute (flutter#2650) Roll Flutter from 077d644 to ab57304 (18 revisions) (flutter#4051) Roll Flutter from 5ae6438 to 077d644 (23 revisions) (flutter#4043) [local_auth] Migrate iOS to Pigeon (flutter#3974) [go_router] fix context extension for replaceNamed (flutter#3927) [image_picker] Fix crash due to `SecurityException` (flutter#4004) Roll Flutter from d0d1feb to 5ae6438 (42 revisions) (flutter#4038) [ci] Lower iOS LUCI timeouts (flutter#4035) [ci] Increase Android sharding (flutter#4029) [flutter_plugin_android_lifecycle] Fix lints (flutter#4030) [rfw] Fix a typo in the API documentation (flutter#4023) ...
flutter/packages@1e214d7...83959fb 2023-05-22 [email protected] [in_app_purchases] Fix mismatching method signature strings (flutter/packages#4040) 2023-05-22 [email protected] [go_router] Nested stateful navigation with ShellRoute (flutter/packages#2650) 2023-05-22 [email protected] [go_router] Nested stateful navigation with ShellRoute (flutter/packages#2650) 2023-05-22 [email protected] [go_router] Nested stateful navigation with ShellRoute (flutter/packages#2650) 2023-05-22 [email protected] Roll Flutter from 077d644 to ab57304 (18 revisions) (flutter/packages#4051) 2023-05-19 [email protected] Roll Flutter from 5ae6438 to 077d644 (23 revisions) (flutter/packages#4043) 2023-05-19 [email protected] [local_auth] Migrate iOS to Pigeon (flutter/packages#3974) 2023-05-19 [email protected] [go_router] fix context extension for replaceNamed (flutter/packages#3927) 2023-05-19 [email protected] [image_picker] Fix crash due to `SecurityException` (flutter/packages#4004) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Issue flutter/flutter#100025 mentions crashing of the image picker plugin due to a `SecurityException`. As research into the issue did not yield reproduction steps, we decided to surround the breaking method call with a `try/catch` block for now (see discussion in the issue). This PR implements just that. Instead of crashing on a `SecurityException`, the plugin will now return an image path of `null`. This PR fixes flutter/flutter#100025.
Issue flutter/flutter#100025 mentions crashing of the image picker plugin due to a
SecurityException
. As research into the issue did not yield reproduction steps, we decided to surround the breaking method call with atry/catch
block for now (see discussion in the issue). This PR implements just that. Instead of crashing on aSecurityException
, the plugin will now return an image path ofnull
.This PR fixes flutter/flutter#100025.
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the [pub versioning philosophy], or this PR is [exempt from version changes].CHANGELOG.md
to add a description of the change, [following repository CHANGELOG style].///
).