diff options
author | zeapo <mohamed@zenadi.com> | 2017-09-10 15:33:40 +0200 |
---|---|---|
committer | zeapo <mohamed@zenadi.com> | 2017-09-10 15:33:40 +0200 |
commit | fdfeaa0043c6d76a19a3df407a47225f1d7f96ae (patch) | |
tree | 9246a0183c008efaafb65d6a39358cc2bcc4af47 /app/src | |
parent | 8e145191fe63e53be9aab521a66d4ac28695c160 (diff) |
fix the logic behind empty dir
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/utils/PasswordRepository.java | 4 |
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(); } |