mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-30 13:35:18 +00:00
Fix for NPE on import
This commit is contained in:
parent
a0a6c3f211
commit
e080449383
@ -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());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user