fix the case where localDir does not exist

which is the common situation..
This commit is contained in:
zeapo 2017-10-30 22:36:46 +01:00
parent d13438b67a
commit e85cd2297b

View file

@ -595,7 +595,7 @@ public class GitActivity extends AppCompatActivity {
} else { } else {
try { try {
// Silently delete & replace the lone .git folder if it exists // 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 { try {
FileUtils.deleteDirectory(localDir); FileUtils.deleteDirectory(localDir);
} catch (IOException e) { } catch (IOException e) {