aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeapo <mohamed@zenadi.com>2017-10-30 22:36:46 +0100
committerzeapo <mohamed@zenadi.com>2017-10-30 22:36:46 +0100
commite85cd2297bdeeaef265b2c825367cd33608f9bc5 (patch)
tree4350fe6c1ac4274b9bac4321cb84a800db70e39a
parentd13438b67a6f51766d22134ba5e976ecb284e492 (diff)
fix the case where localDir does not exist
which is the common situation..
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/git/GitActivity.java2
1 files changed, 1 insertions, 1 deletions
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) {