Add checks for container presence in animation functions to prevent errors when elements are removed from the DOM [skip ci]
This commit is contained in:
@@ -245,6 +245,7 @@ function animateRabbit(rabbit) {
|
||||
|
||||
isAnimating = false;
|
||||
rabbitTimeout = setTimeout(() => {
|
||||
if (!document.body.contains(rabbit)) return;
|
||||
animateRabbit(document.querySelector('#rabbit'));
|
||||
}, restTime);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user