summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/com/android/dialer/calllog/ContactInfoHelper.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/com/android/dialer/calllog/ContactInfoHelper.java b/src/com/android/dialer/calllog/ContactInfoHelper.java
index 01749fc22..3a1144f25 100644
--- a/src/com/android/dialer/calllog/ContactInfoHelper.java
+++ b/src/com/android/dialer/calllog/ContactInfoHelper.java
@@ -64,6 +64,9 @@ public class ContactInfoHelper {
* @param countryIso the country associated with this number
*/
public ContactInfo lookupNumber(String number, String countryIso) {
+ if (TextUtils.isEmpty(number)) {
+ return null;
+ }
final ContactInfo info;
// Determine the contact info.
@@ -149,6 +152,9 @@ public class ContactInfoHelper {
* value.
*/
private ContactInfo lookupContactFromUri(Uri uri) {
+ if (uri == null) {
+ return null;
+ }
final ContactInfo info;
Cursor phonesCursor =
mContext.getContentResolver().query(uri, PhoneQuery._PROJECTION, null, null, null);
@@ -193,6 +199,9 @@ public class ContactInfoHelper {
* If the lookup fails for some other reason, it returns null.
*/
private ContactInfo queryContactInfoForSipAddress(String sipAddress) {
+ if (TextUtils.isEmpty(sipAddress)) {
+ return null;
+ }
final ContactInfo info;
// "contactNumber" is a SIP address, so use the PhoneLookup table with the SIP parameter.
@@ -212,6 +221,9 @@ public class ContactInfoHelper {
* If the lookup fails for some other reason, it returns null.
*/
private ContactInfo queryContactInfoForPhoneNumber(String number, String countryIso) {
+ if (TextUtils.isEmpty(number)) {
+ return null;
+ }
String contactNumber = number;
if (!TextUtils.isEmpty(countryIso)) {
// Normalize the number: this is needed because the PhoneLookup query below does not