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

Commit a0a586cd authored by Maksymilian Osowski's avatar Maksymilian Osowski
Browse files

Fixes crash when root dir does not exist.

Bug: 2904439
Change-Id: I629f88626e165348dd414f3ad49d9b415ab336cf
parent cbfe6ec1
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -68,15 +68,15 @@ public class TestsListPreloaderThread extends Thread {
        File file = new File(TESTS_ROOT_DIR_PATH, mRelativePath);
        if (!file.exists()) {
            Log.e(LOG_TAG + "::run", "Path does not exist: " + mRelativePath);
            return;
        }

        } else {
            /** Populate the tests' list accordingly */
            if (file.isDirectory()) {
                preloadTests(mRelativePath);
            } else {
                mTestsList.add(mRelativePath);
            }
        }

        mDoneMsg.obj = mTestsList;
        mDoneMsg.sendToTarget();
    }
+4 −0
Original line number Diff line number Diff line
@@ -378,6 +378,10 @@ public class DirListActivity extends ListActivity {
    private ListItem[] getDirList(String dirPath) {
        File dir = new File(mRootDirPath, dirPath);

        if (!dir.exists()) {
            return new ListItem[0];
        }

        List<ListItem> subDirs = new ArrayList<ListItem>();
        List<ListItem> subFiles = new ArrayList<ListItem>();