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

Commit a82eeb92 authored by Martin Brabham's avatar Martin Brabham Committed by Martin Brabham
Browse files

Prevent possible OutOfBoundsException

Change-Id: I8fc90a2ade069764732c35b71c5ae450d5d3cc5a
(cherry picked from commit 08a24ffb)
(cherry picked from commit b1faeb65)
parent 90b35201
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -164,6 +164,12 @@ BreadcrumbListener, OnSelectionChangedListener, OnSelectionListener, OnRequestRe
            try {
                // Response if the item can be removed
                FileSystemObjectAdapter adapter = (FileSystemObjectAdapter)parent.getAdapter();

                // Short circuit to protect OOBE
                if (position < 0 || position >= adapter.getCount()) {
                    return false;
                }

                FileSystemObject fso = adapter.getItem(position);
                if (fso != null) {
                    if (fso instanceof ParentDirectory) {