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

Unified Diff: pkg/analysis_server/lib/src/services/linter/linter.dart

Issue 1752183003: Handle incomplete rule options gracefully. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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/analysis_server/test/services/linter/linter_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/services/linter/linter.dart
diff --git a/pkg/analysis_server/lib/src/services/linter/linter.dart b/pkg/analysis_server/lib/src/services/linter/linter.dart
index 675836cee49a2b164f88c34f460bf4034338d34c..964c238d0487f82764e632848baa60603e9969b8 100644
--- a/pkg/analysis_server/lib/src/services/linter/linter.dart
+++ b/pkg/analysis_server/lib/src/services/linter/linter.dart
@@ -40,9 +40,10 @@ class LinterRuleOptionsValidator extends OptionsValidator {
//TODO(pq): migrate this to a proper API once there is one.
Iterable<String> registeredLints = ruleRegistry.map((r) => r.name);
rules.nodes.forEach((YamlNode ruleNode) {
- if (!registeredLints.contains(ruleNode.value)) {
+ Object value = ruleNode.value;
+ if (value != null && !registeredLints.contains(value)) {
reporter.reportErrorForSpan(
- UNDEFINED_LINT_WARNING, ruleNode.span, [ruleNode.value]);
+ UNDEFINED_LINT_WARNING, ruleNode.span, [value]);
}
});
}
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/linter/linter_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698