diff options
author | Jay Shrauner <shrauner@google.com> | 2014-03-03 21:44:04 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-03-03 21:44:04 +0000 |
commit | f83fc5a5de36ddd6a18b1de995e2dc173c4c84d2 (patch) | |
tree | 1fd77578d32b224cdce8c8dfb21a4ddc75e2e5e3 /src | |
parent | 343b90fb7726e45b860ffbf2eb3907eeacb027be (diff) | |
parent | 9108e3d0d9b58251fa888c1415508c60500fa253 (diff) |
am 9108e3d0: am 3a6b35fe: Merge "Fix crash when number is null" into klp-dev
* commit '9108e3d0d9b58251fa888c1415508c60500fa253':
Fix crash when number is null
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/dialer/calllog/PhoneNumberUtilsWrapper.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/com/android/dialer/calllog/PhoneNumberUtilsWrapper.java b/src/com/android/dialer/calllog/PhoneNumberUtilsWrapper.java index 9913c20c6..3eacfec87 100644 --- a/src/com/android/dialer/calllog/PhoneNumberUtilsWrapper.java +++ b/src/com/android/dialer/calllog/PhoneNumberUtilsWrapper.java @@ -50,7 +50,7 @@ public class PhoneNumberUtilsWrapper { * mock-out this, it is not a static method. */ public boolean isVoicemailNumber(CharSequence number) { - return PhoneNumberUtils.isVoiceMailNumber(number.toString()); + return number!= null && PhoneNumberUtils.isVoiceMailNumber(number.toString()); } /** @@ -58,7 +58,7 @@ public class PhoneNumberUtilsWrapper { * static method. */ public boolean isSipNumber(CharSequence number) { - return PhoneNumberUtils.isUriNumber(number.toString()); + return number != null && PhoneNumberUtils.isUriNumber(number.toString()); } public static boolean isUnknownNumberThatCanBeLookedUp(CharSequence number, int presentation) { @@ -77,13 +77,13 @@ public class PhoneNumberUtilsWrapper { if (new PhoneNumberUtilsWrapper().isVoicemailNumber(number)) { return false; } - if (isLegacyUnknownNumbers(number.toString())) { + if (isLegacyUnknownNumbers(number)) { return false; } return true; } public static boolean isLegacyUnknownNumbers(CharSequence number) { - return LEGACY_UNKNOWN_NUMBERS.contains(number.toString()); + return number != null && LEGACY_UNKNOWN_NUMBERS.contains(number.toString()); } } |