Skip to content

Commit 7623d08

Browse files
authored
fix(vdom): add null check in fragment removal Add null check for 'cur' in removeFragment function to prevent potential null reference errors when traversing DOM nodes. The while loop now verifies 'cur' exists before comparing with 'end'. This makes the fragment removal more robust when dealing with edge cases.
1 parent c875019 commit 7623d08

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/runtime-core/src/renderer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2260,7 +2260,7 @@ function baseCreateRenderer(
22602260
// For fragments, directly remove all contained DOM nodes.
22612261
// (fragment child nodes cannot have transition)
22622262
let next
2263-
while (cur !== end) {
2263+
while (cur && cur !== end) {
22642264
next = hostNextSibling(cur)!
22652265
hostRemove(cur)
22662266
cur = next

0 commit comments

Comments
 (0)