Skip to content

Fixed the crash on the terminate method #57

@Brammos

Description

@Brammos

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions