From e85cd2297bdeeaef265b2c825367cd33608f9bc5 Mon Sep 17 00:00:00 2001 From: zeapo Date: Mon, 30 Oct 2017 22:36:46 +0100 Subject: fix the case where localDir does not exist which is the common situation.. --- app/src/main/java/com/zeapo/pwdstore/git/GitActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/src/main/java') diff --git a/app/src/main/java/com/zeapo/pwdstore/git/GitActivity.java b/app/src/main/java/com/zeapo/pwdstore/git/GitActivity.java index 6eabe535..996141a9 100644 --- a/app/src/main/java/com/zeapo/pwdstore/git/GitActivity.java +++ b/app/src/main/java/com/zeapo/pwdstore/git/GitActivity.java @@ -595,7 +595,7 @@ public class GitActivity extends AppCompatActivity { } else { try { // Silently delete & replace the lone .git folder if it exists - if (localDir.listFiles().length == 1 && localDir.listFiles()[0].getName().equals(".git")) { + if (localDir.exists() && localDir.listFiles().length == 1 && localDir.listFiles()[0].getName().equals(".git")) { try { FileUtils.deleteDirectory(localDir); } catch (IOException e) { -- cgit v1.2.3