From c5c30ba14d411b3e23c983912e7fea4f449c9f54 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Fri, 14 Oct 2011 13:39:55 -0700 Subject: NPE check before finalizeDestinationFile(). Bug: 5461417 Change-Id: I16f1e8594162b006b80bf7f2cdc6630d0dedfa38 --- src/com/android/providers/downloads/DownloadThread.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/com/android') 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); + } } /** -- cgit v1.2.3