summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorWink Saville <wink@google.com>2010-10-13 11:40:10 -0700
committerWink Saville <wink@google.com>2010-10-13 11:40:10 -0700
commitc491ee02237fc5c0e6a4ad81ebc899d97c9778b5 (patch)
tree00a6729909c9f4f8cdc135a06605dd1f5c042553 /core
parente22eb863dc4419dcaf329e9e28e3dc1f71f82902 (diff)
downloadframeworks_base-c491ee02237fc5c0e6a4ad81ebc899d97c9778b5.zip
frameworks_base-c491ee02237fc5c0e6a4ad81ebc899d97c9778b5.tar.gz
frameworks_base-c491ee02237fc5c0e6a4ad81ebc899d97c9778b5.tar.bz2
Fix NPE caused by Change I4df27119.
This change caused Music APP to throw an NPE the fix is to test that scheme is not null before using it. Bug: 3092886 Change-Id: Ib29f944cbd9a9ff628462bdd6f4b68a308468536
Diffstat (limited to 'core')
-rw-r--r--core/java/android/content/Intent.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index 7242803..de8e3f4 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -5268,10 +5268,15 @@ public class Intent implements Parcelable, Cloneable {
}
first = false;
b.append("dat=");
- if (mData.getScheme().equalsIgnoreCase("tel")) {
- b.append("tel:xxx-xxx-xxxx");
- } else if (mData.getScheme().equalsIgnoreCase("smsto")) {
- b.append("smsto:xxx-xxx-xxxx");
+ String scheme = mData.getScheme();
+ if (scheme != null) {
+ if (scheme.equalsIgnoreCase("tel")) {
+ b.append("tel:xxx-xxx-xxxx");
+ } else if (scheme.equalsIgnoreCase("smsto")) {
+ b.append("smsto:xxx-xxx-xxxx");
+ } else {
+ b.append(mData);
+ }
} else {
b.append(mData);
}