From f9dd87f6c05a779f9b2edd014948b7c55298f500 Mon Sep 17 00:00:00 2001 From: tdzl2003 Date: Tue, 5 Apr 2016 22:42:16 +0800 Subject: [PATCH] bugfix --- .../main/java/cn/reactnative/modules/update/DownloadTask.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/java/cn/reactnative/modules/update/DownloadTask.java b/android/src/main/java/cn/reactnative/modules/update/DownloadTask.java index 5c13c2c..dbacaed 100644 --- a/android/src/main/java/cn/reactnative/modules/update/DownloadTask.java +++ b/android/src/main/java/cn/reactnative/modules/update/DownloadTask.java @@ -61,7 +61,7 @@ class DownloadTask extends AsyncTask { removeDirectory(f); } } - if (!file.delete()) { + if (file.exists() && !file.delete()) { throw new IOException("Failed to delete directory"); } }