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

Commit 43565345 authored by Ben Kwa's avatar Ben Kwa Committed by Android (Google) Code Review
Browse files

Merge "Fix a crash when browsing empty roots." into nyc-dev

parents ef507c2e 9b3524d8
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);