summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeapo <mohamed@zenadi.com>2017-09-10 15:33:40 +0200
committerzeapo <mohamed@zenadi.com>2017-09-10 15:33:40 +0200
commitfdfeaa0043c6d76a19a3df407a47225f1d7f96ae (patch)
tree9246a0183c008efaafb65d6a39358cc2bcc4af47
parent8e145191fe63e53be9aab521a66d4ac28695c160 (diff)
fix the logic behind empty dir
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/utils/PasswordRepository.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRepository.java b/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRepository.java
index 82e479eb..990aec39 100644
--- a/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRepository.java
+++ b/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRepository.java
@@ -140,9 +140,9 @@ public class PasswordRepository {
}
// uninitialize the repo if the dir does not exist or is absolutely empty
- if (!dir.exists() || !dir.isDirectory()) {
+ if (!dir.exists() || !dir.isDirectory() || dir.listFiles().length == 0) {
settings.edit().putBoolean("repository_initialized", false).apply();
- } else if (dir.listFiles().length > 0) {
+ } else {
settings.edit().putBoolean("repository_initialized", true).apply();
}