maybeGetInitialRouteFromIntent: check if URI data getPath() is null#29766
maybeGetInitialRouteFromIntent: check if URI data getPath() is null#29766fluttergithubbot merged 1 commit intoflutter:mainfrom
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. |
shell/platform/android/io/flutter/embedding/android/FlutterActivityAndFragmentDelegate.java
Show resolved
Hide resolved
|
Looks good to me but I don't know how to test this. cc @blasten for thoughts. |
shell/platform/android/io/flutter/embedding/android/FlutterActivityAndFragmentDelegate.java
Show resolved
Hide resolved
|
cc @blasten. The test has been added per the suggestion. Please take another look. |
|
The linter failure is real. @icota Can you patch that please so we can land this? |
https://developer.android.com/reference/android/net/Uri?hl=da#getPath() getPath returns a null in case of non-hierachical URIs like mailto This avoids the app crashing with: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.isEmpty()' on a null object reference
|
Thanks for letting me know @chinmaygarde. Fixed in 8f9e9ed |
getPath returns a null in case of non-hierachical URIs like
mailtoThis PR avoids the app crashing with:
Fixes flutter/flutter#75261
Pre-launch Checklist
writing and running engine tests.
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.