summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Shrauner <shrauner@google.com>2014-07-02 16:51:29 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-07-01 19:15:58 +0000
commitdcc47113e3a5705e32c9b7e769c38aefdd4bd0e9 (patch)
tree54b807f08af091b96a2a186b46f97a1170b2a18b
parent985fcc6157c0bce86f0354df853d46d945eea0ea (diff)
parent31455929011ffd2d463afcd4e1443c887e3f4a70 (diff)
downloadpackages_apps_ContactsCommon-dcc47113e3a5705e32c9b7e769c38aefdd4bd0e9.tar.gz
packages_apps_ContactsCommon-dcc47113e3a5705e32c9b7e769c38aefdd4bd0e9.tar.bz2
packages_apps_ContactsCommon-dcc47113e3a5705e32c9b7e769c38aefdd4bd0e9.zip
Merge "Fix NPE in isEncodedContactUri"
-rw-r--r--src/com/android/contacts/common/util/UriUtils.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/com/android/contacts/common/util/UriUtils.java b/src/com/android/contacts/common/util/UriUtils.java
index dbe900b5..f8c5aa11 100644
--- a/src/com/android/contacts/common/util/UriUtils.java
+++ b/src/com/android/contacts/common/util/UriUtils.java
@@ -50,6 +50,13 @@ public class UriUtils {
}
public static boolean isEncodedContactUri(Uri uri) {
- return uri != null && uri.getLastPathSegment().equals(Constants.LOOKUP_URI_ENCODED);
+ if (uri == null) {
+ return false;
+ }
+ final String lastPathSegment = uri.getLastPathSegment();
+ if (lastPathSegment == null) {
+ return false;
+ }
+ return lastPathSegment.equals(Constants.LOOKUP_URI_ENCODED);
}
}