Skip to content

Commit

Permalink
fix: skip root module if undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Feb 10, 2025
1 parent 5b7e1a4 commit 1414e2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/injector/topology-tree/topology-tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class TopologyTree {
}

private traverseAndMapToTree(node: TreeNode<Module>, depth = 1) {
if (!node.value?.imports) {
if (!node.value.imports) {
return;
}
node.value.imports.forEach(child => {
Expand Down
3 changes: 3 additions & 0 deletions packages/core/scanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,9 @@ export class DependenciesScanner {
modulesGenerator.next();

const rootModule = modulesGenerator.next().value!;
if (!rootModule) {
return;
}

// Convert modules to an acyclic connected graph
const tree = new TopologyTree(rootModule);
Expand Down

0 comments on commit 1414e2c

Please sign in to comment.