mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-24 23:17:21 +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 directory = new File(getExportDirectoryPath() + File.separator + directoryName);
|
||||||
File importDirectory = new File(context.getFilesDir().getParent() + File.separator + directoryName);
|
File importDirectory = new File(context.getFilesDir().getParent() + File.separator + directoryName);
|
||||||
|
|
||||||
if (directory.exists()) {
|
if (directory.exists() && directory.isDirectory()) {
|
||||||
importDirectory.mkdirs();
|
importDirectory.mkdirs();
|
||||||
|
|
||||||
File[] contents = directory.listFiles();
|
File[] contents = directory.listFiles();
|
||||||
@ -112,7 +112,7 @@ public class ApplicationExporter {
|
|||||||
if (exportedFile.isFile()) {
|
if (exportedFile.isFile()) {
|
||||||
File localFile = new File(importDirectory.getAbsolutePath() + File.separator + exportedFile.getName());
|
File localFile = new File(importDirectory.getAbsolutePath() + File.separator + exportedFile.getName());
|
||||||
migrateFile(exportedFile, localFile);
|
migrateFile(exportedFile, localFile);
|
||||||
} else {
|
} else if (exportedFile.isDirectory()) {
|
||||||
importDirectory(context, directoryName + File.separator + exportedFile.getName());
|
importDirectory(context, directoryName + File.separator + exportedFile.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user