Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the crash on the terminate method #57

Open
Brammos opened this issue Apr 16, 2020 · 0 comments
Open

Fixed the crash on the terminate method #57

Brammos opened this issue Apr 16, 2020 · 0 comments

Comments

@Brammos
Copy link

Brammos commented Apr 16, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant