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

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

Issue 1447123002: Failsafe for unavailable project info (sdk#24947). (Closed) Base URL: https://github.com/dart-lang/linter.git@master
Patch Set: log updates 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_prefixed_library_names.dart
diff --git a/lib/src/rules/package_prefixed_library_names.dart b/lib/src/rules/package_prefixed_library_names.dart
index 15f0e0c9f10a87efc39935221340e8ef23bec202..da450ac7c8f6f7a1b2241fc62f16cdd1b373d5ae 100644
--- a/lib/src/rules/package_prefixed_library_names.dart
+++ b/lib/src/rules/package_prefixed_library_names.dart
@@ -80,6 +80,11 @@ class Visitor extends SimpleAstVisitor {
@override
visitLibraryDirective(LibraryDirective node) {
+ // If no project info is set, bail early.
+ // https://github.com/dart-lang/linter/issues/154
+ if (project == null) {
+ return;
+ }
Source source = node.element.source;
var prefix = createLibraryNamePrefix(
libraryPath: source.fullName,
« 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