Skip to content

Commit

Permalink
fix: add null check for link's target when calling matches to dedupe …
Browse files Browse the repository at this point in the history
…deps
  • Loading branch information
GiveMeSomething committed Jun 5, 2024
1 parent 93883bb commit eb982f4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions workspaces/arborist/lib/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -1113,8 +1113,12 @@ class Node {
}

// if they're links, they match if the targets match
if (this.isLink) {
return node.isLink && this.target.matches(node.target)
if (node.isLink) {
// Linked to nothing, cannot matches
if (!this.target || !node.target) {
return false;
}
return this.target.matches(node.target);
}

// if they're two project root nodes, they're different if the paths differ
Expand Down

0 comments on commit eb982f4

Please sign in to comment.