Skip to content
This repository was archived by the owner on Nov 20, 2024. It is now read-only.

Commit 83453a4

Browse files
committed
Failsafe for unavailable project info (sdk#24947).
See: dart-lang/sdk#24947 [email protected] Review URL: https://codereview.chromium.org//1447123002 .
1 parent 297213f commit 83453a4

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.1.6
2+
3+
* Fix to `package_prefixed_library_names` (dart-lang/sdk#24947; #154).
4+
15
# 0.1.5
26

37
* Added `prefer_is_not_empty` lint rule (#143).

lib/src/rules/package_prefixed_library_names.dart

+5
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ class Visitor extends SimpleAstVisitor {
8080

8181
@override
8282
visitLibraryDirective(LibraryDirective node) {
83+
// If no project info is set, bail early.
84+
// https://github.com/dart-lang/linter/issues/154
85+
if (project == null) {
86+
return;
87+
}
8388
Source source = node.element.source;
8489
var prefix = createLibraryNamePrefix(
8590
libraryPath: source.fullName,

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: linter
2-
version: 0.1.5
2+
version: 0.1.6
33
author: Dart Team <[email protected]>
44
description: Style linter for Dart.
55
homepage: https://github.com/dart-lang/linter

0 commit comments

Comments
 (0)