From fdfeaa0043c6d76a19a3df407a47225f1d7f96ae Mon Sep 17 00:00:00 2001 From: zeapo Date: Sun, 10 Sep 2017 15:33:40 +0200 Subject: fix the logic behind empty dir --- app/src/main/java/com/zeapo/pwdstore/utils/PasswordRepository.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/src/main') 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(); } -- cgit v1.2.3