diff --git a/CHANGELOG.md b/CHANGELOG.md index a35ae951f..3bf70cb06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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). diff --git a/lib/src/rules/package_prefixed_library_names.dart b/lib/src/rules/package_prefixed_library_names.dart index 15f0e0c9f..da450ac7c 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, diff --git a/pubspec.yaml b/pubspec.yaml index 6c2eb781d..a89ecf6c9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: linter -version: 0.1.5 +version: 0.1.6 author: Dart Team description: Style linter for Dart. homepage: https://github.com/dart-lang/linter