Fixes crash when root dir does not exist.

Bug: 2904439
Change-Id: I629f88626e165348dd414f3ad49d9b415ab336cf
This commit is contained in:
Maksymilian Osowski
2010-08-11 12:42:57 +01:00
parent cbfe6ec1b4
commit a0a586cd2f
2 changed files with 11 additions and 7 deletions

View File

@@ -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);
}
}
/** Populate the tests' list accordingly */
if (file.isDirectory()) {
preloadTests(mRelativePath);
} else {
mTestsList.add(mRelativePath);
}
mDoneMsg.obj = mTestsList;
mDoneMsg.sendToTarget();
}

View File

@@ -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>();