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

Unified Diff: pkg/analyzer/lib/source/analysis_options_provider.dart

Issue 1369573003: Fix handling of empty .analysis_options files and test this case (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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 | pkg/analyzer/test/source/analysis_options_provider_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/source/analysis_options_provider.dart
diff --git a/pkg/analyzer/lib/source/analysis_options_provider.dart b/pkg/analyzer/lib/source/analysis_options_provider.dart
index a3ac86bc4a8cb1e72c649fb3069c23f3f718abb1..1c05375fc1f32483327cc97d59ccfca9a49dc4ba 100644
--- a/pkg/analyzer/lib/source/analysis_options_provider.dart
+++ b/pkg/analyzer/lib/source/analysis_options_provider.dart
@@ -35,9 +35,11 @@ class AnalysisOptionsProvider {
return options;
}
var doc = loadYaml(optionsSource);
- if (doc is! YamlMap) {
+ if ((doc != null) && (doc is! YamlMap)) {
throw new Exception(
- 'Bad options file format (expected map, got ${doc.runtimeType})');
+ 'Bad options file format (expected map, got ${doc.runtimeType})\n'
+ 'contents of options file:\n'
+ '$optionsSource\n');
}
if (doc is YamlMap) {
doc.forEach((k, v) {
« no previous file with comments | « no previous file | pkg/analyzer/test/source/analysis_options_provider_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698