diff options
| author | 2010-09-30 17:22:35 -0700 | |
|---|---|---|
| committer | 2010-09-30 17:22:35 -0700 | |
| commit | efb8b42789a291e38a7e837f64d18bcb511f65f9 (patch) | |
| tree | a751563aff9a0b7e022a98bfb4f2a3da1ceba9da | |
| parent | 738aadd70fb96491e34645e78241eeb04ee83460 (diff) | |
| parent | 4ba2817c869d4ec6b518a57ea32cc3765b18b0db (diff) | |
am 4ba2817c: Merge "Avoid NPE when viewing failed legacy download with no local path" into gingerbread
Merge commit '4ba2817c869d4ec6b518a57ea32cc3765b18b0db' into gingerbread-plus-aosp
* commit '4ba2817c869d4ec6b518a57ea32cc3765b18b0db':
Avoid NPE when viewing failed legacy download with no local path
| -rw-r--r-- | core/java/android/app/DownloadManager.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/java/android/app/DownloadManager.java b/core/java/android/app/DownloadManager.java index 3ec21ff90900..9d559d4664a3 100644 --- a/core/java/android/app/DownloadManager.java +++ b/core/java/android/app/DownloadManager.java @@ -923,7 +923,11 @@ public class DownloadManager { if (destinationType == Downloads.Impl.DESTINATION_EXTERNAL) { // return stored destination for legacy external download - return Uri.fromFile(new File(getUnderlyingString(Downloads.Impl._DATA))).toString(); + String localPath = getUnderlyingString(Downloads.Impl._DATA); + if (localPath == null) { + return null; + } + return Uri.fromFile(new File(localPath)).toString(); } // return content URI for cache download |