Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 438559e1 authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Ensure null/empty phone number does not crash international number check.

Add empty/null check for isInternationalNumber.

Test: Added unit tests.
Bug: 62162029
Change-Id: I779a1f78cbbe11adeefeca7fc83cfc1cfa431c61
parent 7990306b
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1449,6 +1449,11 @@ public class PhoneNumberUtils
     * @hide
     */
    public static boolean isInternationalNumber(String phoneNumber, String defaultCountryIso) {
        // If no phone number is provided, it can't be international.
        if (TextUtils.isEmpty(phoneNumber)) {
            return false;
        }

        // If it starts with # or * its not international.
        if (phoneNumber.startsWith("#") || phoneNumber.startsWith("*")) {
            return false;