summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Howard <showard@google.com>2010-09-30 19:45:56 -0700
committerSteve Howard <showard@google.com>2010-09-30 19:45:56 -0700
commit5d81e2447ed77860afecd71583e137178c2c6807 (patch)
tree6b059217d55748d9ef76e04906761e3570aa43ca
parent8df47822435f7f66dd34f87dcaa73bbbcd808483 (diff)
downloadandroid_packages_providers_DownloadProvider-5d81e2447ed77860afecd71583e137178c2c6807.zip
android_packages_providers_DownloadProvider-5d81e2447ed77860afecd71583e137178c2c6807.tar.gz
android_packages_providers_DownloadProvider-5d81e2447ed77860afecd71583e137178c2c6807.tar.bz2
Avoid NPE when checking file URI in DownloadProvider
Change-Id: Ic937b05308cecce244725e25767a3a1310a8463d
-rw-r--r--src/com/android/providers/downloads/DownloadProvider.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/com/android/providers/downloads/DownloadProvider.java b/src/com/android/providers/downloads/DownloadProvider.java
index 2cbf7fb..9b86adf 100644
--- a/src/com/android/providers/downloads/DownloadProvider.java
+++ b/src/com/android/providers/downloads/DownloadProvider.java
@@ -538,7 +538,8 @@ public final class DownloadProvider extends ContentProvider {
"DESTINATION_FILE_URI must include a file URI under COLUMN_FILE_NAME_HINT");
}
Uri uri = Uri.parse(fileUri);
- if (!uri.getScheme().equals("file")) {
+ String scheme = uri.getScheme();
+ if (scheme == null || !scheme.equals("file")) {
throw new IllegalArgumentException("Not a file URI: " + uri);
}
String path = uri.getPath();