Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a98f744 authored by Alan Viverette's avatar Alan Viverette
Browse files

Fix NPE when ripples are canceled due to visibility change

BUG: 15406248
Change-Id: I63ce42fef8e1614372ee4a82e45eb15e8bbe1fe3
parent 6fbe3982
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -441,8 +441,11 @@ public class RippleDrawable extends LayerDrawable {
        final int count = mAnimatingRipplesCount;
        final Ripple[] ripples = mAnimatingRipples;
        for (int i = 0; i < count; i++) {
            ripples[i].cancel();
            // Calling cancel may remove the ripple from the animating ripple
            // array, so cache the reference before nulling it out.
            final Ripple ripple = ripples[i];
            ripples[i] = null;
            ripple.cancel();
        }

        mAnimatingRipplesCount = 0;