diff --git a/lottie/src/main/java/com/airbnb/lottie/animation/keyframe/ColorKeyframeAnimation.java b/lottie/src/main/java/com/airbnb/lottie/animation/keyframe/ColorKeyframeAnimation.java index 3c83b2684a..93bf944845 100644 --- a/lottie/src/main/java/com/airbnb/lottie/animation/keyframe/ColorKeyframeAnimation.java +++ b/lottie/src/main/java/com/airbnb/lottie/animation/keyframe/ColorKeyframeAnimation.java @@ -25,7 +25,10 @@ public int getIntValue(Keyframe keyframe, float keyframeProgress) { throw new IllegalStateException("Missing values for keyframe."); } - if (valueCallback != null) { + // keyframe.endFrame should not be null under normal operation. + // It is not clear why this would be null and when it does, it seems to be extremely rare. + // https://github.com/airbnb/lottie-android/issues/2361 + if (valueCallback != null && keyframe.endFrame != null) { //noinspection ConstantConditions Integer value = valueCallback.getValueInternal(keyframe.startFrame, keyframe.endFrame, keyframe.startValue, keyframe.endValue, keyframeProgress, getLinearCurrentKeyframeProgress(), getProgress());