Fix for NPE on import

This commit is contained in:
Moxie Marlinspike 2013-05-21 13:25:44 -07:00
parent a0a6c3f211
commit e080449383

View File

@ -103,7 +103,7 @@ public class ApplicationExporter {
File directory = new File(getExportDirectoryPath() + File.separator + directoryName);
File importDirectory = new File(context.getFilesDir().getParent() + File.separator + directoryName);
if (directory.exists()) {
if (directory.exists() && directory.isDirectory()) {
importDirectory.mkdirs();
File[] contents = directory.listFiles();
@ -112,7 +112,7 @@ public class ApplicationExporter {
if (exportedFile.isFile()) {
File localFile = new File(importDirectory.getAbsolutePath() + File.separator + exportedFile.getName());
migrateFile(exportedFile, localFile);
} else {
} else if (exportedFile.isDirectory()) {
importDirectory(context, directoryName + File.separator + exportedFile.getName());
}
}