We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cce42a3 commit 334a131Copy full SHA for 334a131
pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart
@@ -922,10 +922,17 @@ class BulkFixProcessor {
922
Set<String> usedDevDeps,
923
ResourceProvider resourceProvider) async {
924
String contents = pubspec.contents.data;
925
- YamlNode node = loadYamlNode(contents);
+ YamlNode? node;
926
+ try {
927
+ node = loadYamlNode(contents);
928
+ } catch (_) {
929
+ // Could not parse the pubspec file.
930
+ return [];
931
+ }
932
+
933
if (node is! YamlMap) {
934
// The file is empty.
- node = YamlMap();
935
936
}
937
938
var errors = MissingDependencyValidator(node, pubspec, resourceProvider)
0 commit comments