confetti
confetti copied to clipboard
Fixed the crash on the terminate method
Hey,
I fixed the crash on the terminate method:
/**
* Terminate the currently running animation if there is any.
*/
public void terminate() {
if (animator != null) {
animator.cancel();
}
if (confettiView != null && confettiView.getParent() != null)
confettiView.terminate();
if (animationListener != null) {
animationListener.onAnimationEnd(this);
}
}
The problem is when you initialize an ConfettiManager with confettiView null the terminate method will crash. This is easily avoidable by adding this extra check. I've tried making an PR for it but i can't seem to push on a separate branch getting error 403.
Btw this crash happens in Kotlin because you van initialize the ConfettiManager as Confettimanager(ConfettoGenerator,ConfettiSource,null,null) if you want.