Skip to content

Commit 40a5867

Browse files
committed
fix: prevent calling remove fn with null value in snippet_effect
1 parent a31b2e1 commit 40a5867

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/svelte/src/internal/client/render.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3182,8 +3182,9 @@ export function snippet_effect(get_snippet, node, args) {
31823182
const snippet = get_snippet();
31833183
untrack(() => snippet(node, args));
31843184
return () => {
3185-
if (block.d !== null) {
3186-
remove(block.d);
3185+
const d = (is_array(block.d) ? block.d[0] : block.d) ?? null;
3186+
if (d !== null) {
3187+
remove(d);
31873188
}
31883189
};
31893190
}, block);

0 commit comments

Comments
 (0)