From 79e99cceac439c18e6f048fdb1b8875e91fdf120 Mon Sep 17 00:00:00 2001 From: zeapo Date: Thu, 10 Aug 2017 11:43:15 +0200 Subject: no need to list files as a store can be empty --- app/src/main/java/com/zeapo/pwdstore/PasswordStore.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java index dd79de8b..5f4e3096 100644 --- a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java +++ b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java @@ -307,11 +307,11 @@ public class PasswordStore extends AppCompatActivity { } private void initializeRepositoryInfo() { - if (settings.getBoolean("git_external", false) && settings.getString("git_external_repo", null) != null) { - File dir = new File(settings.getString("git_external_repo", null)); + final String externalRepoPath = settings.getString("git_external_repo", null); + if (settings.getBoolean("git_external", false) && externalRepoPath != null) { + File dir = new File(externalRepoPath); - if (dir.exists() && dir.isDirectory() && !FileUtils.listFiles(dir, null, true).isEmpty() && - !PasswordRepository.getPasswords(dir, PasswordRepository.getRepositoryDirectory(this)).isEmpty()) { + if (dir.exists() && dir.isDirectory() && !PasswordRepository.getPasswords(dir, PasswordRepository.getRepositoryDirectory(this)).isEmpty()) { PasswordRepository.closeRepository(); checkLocalRepository(); return; // if not empty, just show me the passwords! -- cgit v1.2.3