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

Unified Diff: lib/src/rules/package_api_docs.dart

Issue 1446383002: Bail early in API analysis if no project is set. (Closed) Base URL: https://github.com/dart-lang/linter.git@master
Patch Set: Created 5 years, 1 month 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 | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/rules/package_api_docs.dart
diff --git a/lib/src/rules/package_api_docs.dart b/lib/src/rules/package_api_docs.dart
index 0ee3e3482150e12da856ce9b69b09ab7e6146705..3a4966e32e666d0eafe2ad09b3443f8f6db69ca8 100644
--- a/lib/src/rules/package_api_docs.dart
+++ b/lib/src/rules/package_api_docs.dart
@@ -88,6 +88,11 @@ class Visitor extends GeneralizingAstVisitor {
DartProject get project => rule.project;
void check(Declaration node) {
+ // If no project info is set, bail early.
+ // https://github.com/dart-lang/linter/issues/154
+ if (project == null) {
+ return;
+ }
if (project.isApi(node.element)) {
if (node.documentationComment == null) {
rule.reportLint(getNodeToAnnotate(node));
« no previous file with comments | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698