Skip to content

Commit 0c8e9ee

Browse files
asattelmaieraddaleax
authored andcommitted
test: fix for activities in tick objects prune function
PR-URL: #26163 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 69154e4 commit 0c8e9ee

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/async-hooks/verify-graph.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,15 @@ function pruneTickObjects(activities) {
2323
data: null
2424
};
2525

26+
if (!Array.isArray(activities))
27+
return activities;
28+
2629
while (tickObject.found) {
2730
for (let i = 0; i < activities.length; i++) {
2831
if (activities[i].type === 'TickObject') {
2932
tickObject.index = i;
3033
break;
31-
} else if (i + 1 === activities.length) {
34+
} else if (i + 1 >= activities.length) {
3235
tickObject.found = false;
3336
}
3437
}

0 commit comments

Comments
 (0)