Skip to content

[flutter_tools] handle missing null check in manifest parser #57400

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

Merged
merged 1 commit into from
May 18, 2020

Conversation

jonahwilliams
Copy link
Member

Description

This assert should have been a null check to prevent an NPE when <application> is missing from the android manifest.

Fixes #57281

@fluttergithubbot fluttergithubbot added the tool Affects the "flutter" command-line tool. See also t: labels. label May 16, 2020
Copy link
Member

@zanderso zanderso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm w/ question.

@@ -565,7 +565,9 @@ class ApkManifestData {
}

final _Element application = manifest.firstElement('application');
assert(application != null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about the assert up on line 537? Does it need the same fix?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure since I don't have the original context. It is possible the dump output never contains fewer than 3 lines, so that prevents test regressions.

@jonahwilliams jonahwilliams merged commit 91ec439 into flutter:master May 18, 2020
@jonahwilliams jonahwilliams deleted the parseFromXmlDump_fix branch May 18, 2020 19:47
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[tool_crash] NoSuchMethodError: The method 'allElements' was called on null.Receiver: nullTried calling: allElements("activity")
4 participants