Skip to content

Commit

Permalink
check for null packages (dart-lang#1866)
Browse files Browse the repository at this point in the history
  • Loading branch information
pq authored Dec 3, 2019
1 parent ed31be8 commit 59b8e18
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/src/ast.dart
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ bool isHashCode(ClassMember element) =>
/// Return true if this compilation unit [node] is declared within the given
/// [package]'s `lib/` directory tree.
bool isInLibDir(CompilationUnit node, WorkspacePackage package) {
if (package == null) return false;
final cuPath = node.declaredElement.library?.source?.fullName;
if (cuPath == null) return false;
final libDir = path.join(package.root, 'lib');
Expand Down

0 comments on commit 59b8e18

Please sign in to comment.