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

Commit 59b2f65c authored by Jay Shrauner's avatar Jay Shrauner
Browse files

Fix NPE in onPanelSlide

Check for null SwipeableShortcutCard returned by getChildAt(0).

Bug:16036815
Change-Id: I1e81a535e493427a694fdfd1e20429c4d01b477f
parent e9b92901
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -141,8 +141,8 @@ public class ListsFragment extends Fragment implements CallLogQueryHandler.Liste
            // slideOffset is 1 when the shortcut card is fully exposed, and 0 when completely
            // hidden.
            float ratioCardHidden = (1 - slideOffset) * 1.5f;
            if (mShortcutCardsListView.getCount() > 0) {
                SwipeableShortcutCard v =
            if (mShortcutCardsListView.getChildCount() > 0) {
                final SwipeableShortcutCard v =
                        (SwipeableShortcutCard) mShortcutCardsListView.getChildAt(0);
                v.clipCard(ratioCardHidden);
            }
@@ -348,7 +348,7 @@ public class ListsFragment extends Fragment implements CallLogQueryHandler.Liste
        mRemoveView.setAlpha(show ? 0 : 1);
        mRemoveView.animate().alpha(show ? 1 : 0).start();

        if (mShortcutCardsListView.getCount() > 0) {
        if (mShortcutCardsListView.getChildCount() > 0) {
            View v = mShortcutCardsListView.getChildAt(0);
            v.animate().withLayer()
                    .alpha(show ? REMOVE_VIEW_SHOWN_ALPHA : REMOVE_VIEW_HIDDEN_ALPHA)