Skip to content

Commit

Permalink
Fix a Xiaomi specific crash (#2061)
Browse files Browse the repository at this point in the history
Fixes #2050
  • Loading branch information
gpeal committed Apr 23, 2022
1 parent 0f0bc6f commit d612830
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -101,7 +101,9 @@ float getLinearCurrentKeyframeProgress() {
*/
protected float getInterpolatedCurrentKeyframeProgress() {
Keyframe<K> keyframe = getCurrentKeyframe();
if (keyframe.isStatic()) {
// Keyframe should not be null here but there seems to be a Xiaomi Android 10 specific crash.
// https://github.com/airbnb/lottie-android/issues/2050
if (keyframe == null || keyframe.isStatic()) {
return 0f;
}
//noinspection ConstantConditions
Expand Down

0 comments on commit d612830

Please sign in to comment.