Skip to content

Commit eb68ec0

Browse files
committed
Let's go safe here
1 parent 6ec2226 commit eb68ec0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/knip/src/util/graph-sequencer.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,9 @@ export function graphSequencer<T>(graph: Graph<T>, includedNodes: T[] = [...grap
106106
while (queue.length) {
107107
// biome-ignore lint/style/noNonNullAssertion: deal with it
108108
const [id, cycle] = queue.shift()!;
109-
// biome-ignore lint/style/noNonNullAssertion: deal with it
110-
for (const to of graph.get(id)!) {
109+
const nodes = graph.get(id);
110+
if (!nodes) continue;
111+
for (const to of nodes) {
111112
if (to === startNode) {
112113
cycleVisited.add(to);
113114
cycles.push([...cycle]);

0 commit comments

Comments
 (0)