diff --git a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.java b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.java index 16bf4547..9578df0d 100644 --- a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.java +++ b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.java @@ -377,8 +377,7 @@ public class AutofillService extends AccessibilityService { } private ArrayList searchPasswords(File path, String appName) { - ArrayList passList - = PasswordRepository.getFilesList(path); + ArrayList passList = PasswordRepository.getFilesList(path); if (passList.size() == 0) return new ArrayList<>(); 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 990aec39..e232b8a0 100644 --- a/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRepository.java +++ b/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRepository.java @@ -166,7 +166,7 @@ public class PasswordRepository { * @return the list of gpg files in that directory */ public static ArrayList getFilesList(File path) { - if (!path.exists()) return new ArrayList<>(); + if (path == null || !path.exists()) return new ArrayList<>(); Log.d("REPO", "current path: " + path.getPath()); List directories = Arrays.asList(path.listFiles((FileFilter) FileFilterUtils.directoryFileFilter()));