Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1857)

Unified Diff: dart/utils/pub/pubspec.dart

Issue 10534081: pub: treat a pubspec with just comments as empty (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: with tests Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | dart/utils/tests/pub/pubspec_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/utils/pub/pubspec.dart
diff --git a/dart/utils/pub/pubspec.dart b/dart/utils/pub/pubspec.dart
index d3a5bb8358969f383f7c7386b68a910b90f392b4..767a79176cfdd2a0812be2ba4ff8c7a33fac9354 100644
--- a/dart/utils/pub/pubspec.dart
+++ b/dart/utils/pub/pubspec.dart
@@ -42,6 +42,8 @@ class Pubspec {
if (contents.trim() == '') return new Pubspec.empty();
var parsedPubspec = loadYaml(contents);
+ if (parsedPubspec == null) return new Pubspec.empty();
+
if (parsedPubspec is! Map) {
throw new FormatException('The pubspec must be a YAML mapping.');
}
« no previous file with comments | « no previous file | dart/utils/tests/pub/pubspec_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698