summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2011-10-14 13:39:55 -0700
committerJeff Sharkey <jsharkey@android.com>2011-10-14 13:39:55 -0700
commitc5c30ba14d411b3e23c983912e7fea4f449c9f54 (patch)
tree57e0609aada9fbb5cce054b94338ae1df882da07 /src
parent0ca8ce569a4d12ac9ef6845caee50e369b56ab84 (diff)
downloadandroid_packages_providers_DownloadProvider-c5c30ba14d411b3e23c983912e7fea4f449c9f54.tar.gz
android_packages_providers_DownloadProvider-c5c30ba14d411b3e23c983912e7fea4f449c9f54.tar.bz2
android_packages_providers_DownloadProvider-c5c30ba14d411b3e23c983912e7fea4f449c9f54.zip
NPE check before finalizeDestinationFile().
Bug: 5461417 Change-Id: I16f1e8594162b006b80bf7f2cdc6630d0dedfa38
Diffstat (limited to 'src')
-rw-r--r--src/com/android/providers/downloads/DownloadThread.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/com/android/providers/downloads/DownloadThread.java b/src/com/android/providers/downloads/DownloadThread.java
index c4b6353e..63a51a8f 100644
--- a/src/com/android/providers/downloads/DownloadThread.java
+++ b/src/com/android/providers/downloads/DownloadThread.java
@@ -315,9 +315,11 @@ public class DownloadThread extends Thread {
* Called after a successful completion to take any necessary action on the downloaded file.
*/
private void finalizeDestinationFile(State state) throws StopRequestException {
- // make sure the file is readable
- FileUtils.setPermissions(state.mFilename, 0644, -1, -1);
- syncDestination(state);
+ if (state.mFilename != null) {
+ // make sure the file is readable
+ FileUtils.setPermissions(state.mFilename, 0644, -1, -1);
+ syncDestination(state);
+ }
}
/**