Skip to content
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

prevent VsCode from crashing on malformed packages.json file #45786

Merged

Conversation

jonahwilliams
Copy link
Member

Description

If packages.json was malformed, flutter doctor could crash due to an uncaught FormatException. Catch the error and fallback to an unknown version

Fixes #45753

@fluttergithubbot fluttergithubbot added the tool Affects the "flutter" command-line tool. See also t: labels. label Nov 28, 2019
@jonahwilliams jonahwilliams merged commit 8cf20f3 into flutter:master Dec 3, 2019
@jonahwilliams jonahwilliams deleted the fix_vscode_doctor_check branch December 3, 2019 01:04
final Map<String, dynamic> jsonObject = castStringKeyedMap(json.decode(jsonString));
return jsonObject['version'] as String;
} on FormatException {
return null;
Copy link
Member

Choose a reason for hiding this comment

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

Consider putting a printTrace() here.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 3, 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.

flutter has exited unexpectedly.
5 participants