Prevent a NPE when creating LottieAnimationView
@@ -753,6 +753,11 @@ public class LottieDrawable extends Drawable implements Drawable.Callback, Anima
}
public boolean isAnimating() {
+ // On some versions of Android, this is called from the LottieAnimationView constructor, before animator was created.
+ // https://github.com/airbnb/lottie-android/issues/1430
+ if (animator == null) {
+ return false;
+ }
return animator.isRunning();
}
