Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Fix error reading matches of null when install dependencies #7588

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: add null check for link's target when calling matches to dedupe …
…deps
GiveMeSomething committed Jun 5, 2024
commit eb982f4f66d7f3c5a215d4500ece95f1f93a2fec
8 changes: 6 additions & 2 deletions workspaces/arborist/lib/node.js
Original file line number Diff line number Diff line change
@@ -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