aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Peal <gpeal@users.noreply.github.com>2019-11-18 10:15:27 -0800
committerGitHub <noreply@github.com>2019-11-18 10:15:27 -0800
commitda96f5c8d8d1ef530d6632e94a42933a739786a7 (patch)
tree5f5e89565538467783488317f05f6b71d408d2d7
parent63ad54bb6881900c27dbb345874c0919abf07e0a (diff)
downloadlottie-da96f5c8d8d1ef530d6632e94a42933a739786a7.tar.gz
Prevent a NPE when creating LottieAnimationView (#1434)
-rw-r--r--lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java b/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java
index a1ed28d8..c17cdf34 100644
--- a/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java
+++ b/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java
@@ -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();
}