[flutter_tools] dont crash on invalid utf8 in pubspec (#73891)

This commit is contained in:
Jonah Williams
2021-01-13 14:25:16 -08:00
committed by GitHub
parent d4f0c08261
commit 1eb0bb52e1
2 changed files with 22 additions and 0 deletions

View File

@@ -221,6 +221,12 @@ class FlutterProject {
} on YamlException catch (e) {
logger.printStatus('Error detected in pubspec.yaml:', emphasis: true);
logger.printError('$e');
} on FormatException catch (e) {
logger.printError('Error detected while parsing pubspec.yaml:', emphasis: true);
logger.printError('$e');
} on FileSystemException catch (e) {
logger.printError('Error detected while reading pubspec.yaml:', emphasis: true);
logger.printError('$e');
}
if (manifest == null) {
throwToolExit('Please correct the pubspec.yaml file at $path');