-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[path_provider] Fix handling of null application ID #4606
[path_provider] Fix handling of null application ID #4606
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
The lookup of application ID was handling `null` (Dart null), but not `nullptr` (Dart representation of a C null pointer), so was throwing an exception in applications without an application ID. This includes the `shared_preferences_linux` example application, so this fixes tree breakage.
d4a9338
to
dc1d4e6
Compare
I forgot to |
@@ -2,7 +2,7 @@ name: path_provider_linux | |||
description: Linux implementation of the path_provider plugin | |||
repository: https://github.com/flutter/plugins/tree/master/packages/path_provider/path_provider_linux | |||
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+path_provider%22 | |||
version: 2.1.3 | |||
version: 2.1.4 |
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.
I remember even for @VisibleForTesting API updates, we need to bump minor? (I might be wrong)
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.
The file that I added the new content to shouldn't be exported. I just wanted to be extra-obvious about it being test-only.
packages/path_provider/path_provider_linux/test/get_application_id_test.dart
Outdated
Show resolved
Hide resolved
packages/path_provider/path_provider_linux/test/get_application_id_test.dart
Outdated
Show resolved
Hide resolved
packages/path_provider/path_provider_linux/test/get_application_id_test.dart
Outdated
Show resolved
Hide resolved
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
Landing on red to fix tree |
The lookup of application ID was handling `null` (Dart null), but not `nullptr` (Dart representation of a C null pointer), so was throwing an exception in applications without an application ID. This includes the `shared_preferences_linux` example application, so this fixes tree breakage.
The lookup of application ID was handling `null` (Dart null), but not `nullptr` (Dart representation of a C null pointer), so was throwing an exception in applications without an application ID. This includes the `shared_preferences_linux` example application, so this fixes tree breakage.
The lookup of application ID was handling
null
(Dart null), but notnullptr
(Dart representation of a C null pointer), so was throwing anexception in applications without an application ID.
Refactors the FFI calls into a wrapper so that they can be faked for
unit testing.
This includes the
shared_preferences_linux
example application, sothis fixes tree breakage.
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.///
).