Skip to content

Commit fb85107

Browse files
committed
fix: fix manipulation (related to #1409)
1 parent c126733 commit fb85107

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/ts-morph/src/manipulation/nodeHandlers/RangeHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class RangeHandler implements NodeHandler {
5656
newNodeChildren.next();
5757

5858
// handle the rest
59-
while (!currentNodeChildren.done)
59+
while (!currentNodeChildren.done && !newNodeChildren.done)
6060
this.straightReplace(currentNodeChildren.next(), newNodeChildren.next(), newSourceFile);
6161

6262
// ensure the new children iterator is done too

0 commit comments

Comments
 (0)