Fixes crash when root dir does not exist.
Bug: 2904439 Change-Id: I629f88626e165348dd414f3ad49d9b415ab336cf
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user