Skip to content

Commit

Permalink
Failsafe for unavailable project info (sdk#24947).
Browse files Browse the repository at this point in the history
  • Loading branch information
pq committed Nov 16, 2015
1 parent 297213f commit 83453a4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.1.6

* Fix to `package_prefixed_library_names` (dart-lang/sdk#24947; #154).

# 0.1.5

* Added `prefer_is_not_empty` lint rule (#143).
Expand Down
5 changes: 5 additions & 0 deletions lib/src/rules/package_prefixed_library_names.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: linter
version: 0.1.5
version: 0.1.6
author: Dart Team <[email protected]>
description: Style linter for Dart.
homepage: https://github.com/dart-lang/linter
Expand Down

0 comments on commit 83453a4

Please sign in to comment.