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

Commit 9b3524d8 authored by Ben Kwa's avatar Ben Kwa
Browse files

Fix a crash when browsing empty roots.

BUG=27292682

Change-Id: I383fd359a959e86fca3f6716575027aa3b4723cf
parent dd6e4c19
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -113,6 +113,11 @@ class FocusManager implements View.OnFocusChangeListener {
     * Requests focus on the item that last had focus. Scrolls to that item if necessary.
     */
    public void restoreLastFocus() {
        if (mAdapter.getItemCount() == 0) {
            // Nothing to focus.
            return;
        }

        if (mLastFocusPosition != RecyclerView.NO_POSITION) {
            // The system takes care of situations when a view is no longer on screen, etc,
            focusItem(mLastFocusPosition);