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

Commit 80032093 authored by George Mount's avatar George Mount
Browse files

Fix endTransition index out of bounds exception.

Bug 22063111

When transition.end() is run, it removes itself from
the list of running transitions and perturbs the list.

Change-Id: I4feb7ebe19717a0e2302844d4e4e0d19a55ec57c
parent 82e595fd
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -435,10 +435,11 @@ public class TransitionManager {
        sPendingTransitions.remove(sceneRoot);

        final ArrayList<Transition> runningTransitions = getRunningTransitions().get(sceneRoot);
        if (runningTransitions != null) {
            final int count = runningTransitions.size();
            for (int i = 0; i < count; i++) {
                final Transition transition = runningTransitions.get(i);
        if (runningTransitions != null && !runningTransitions.isEmpty()) {
            // Make a copy in case this is called by an onTransitionEnd listener
            ArrayList<Transition> copy = new ArrayList(runningTransitions);
            for (int i = copy.size() - 1; i >= 0; i--) {
                final Transition transition = copy.get(i);
                transition.end();
            }
        }