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

Commit 83c692ef authored by George Mount's avatar George Mount
Browse files

Fix NPE when rejected snapshots are null.

Bug 18055705

Change-Id: Id0b98e7da5510af438c5d66c0ddb00489d581864
parent 104d2484
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -322,6 +322,7 @@ class EnterTransitionCoordinator extends ActivityTransitionCoordinator {
        if (mListener != null) {
            mListener.onRejectSharedElements(rejectedSnapshots);
        }
        removeNullViews(rejectedSnapshots);
        startRejectedAnimations(rejectedSnapshots);

        // Now start shared element transition
@@ -370,6 +371,16 @@ class EnterTransitionCoordinator extends ActivityTransitionCoordinator {
        }
    }

    private static void removeNullViews(ArrayList<View> views) {
        if (views != null) {
            for (int i = views.size() - 1; i >= 0; i--) {
                if (views.get(i) == null) {
                    views.remove(i);
                }
            }
        }
    }

    private void onTakeSharedElements() {
        if (!mIsReadyForTransition || mSharedElementsBundle == null) {
            return;