Skip to content

Commit

Permalink
Merge pull request #229 from Bwc9876/patch-1
Browse files Browse the repository at this point in the history
Add contains check for canvas when removing
  • Loading branch information
catdad authored Apr 30, 2024
2 parents 4c1c86d + 6526a57 commit 92e2120
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/confetti.js
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,9 @@
}

if (isLibCanvas && canvas) {
document.body.removeChild(canvas);
if (document.body.contains(canvas)) {
document.body.removeChild(canvas);
}
canvas = null;
initialized = false;
}
Expand Down

0 comments on commit 92e2120

Please sign in to comment.