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

Commit af834d66 authored by kaiyiz's avatar kaiyiz Committed by Linux Build Service Account
Browse files

Telephony: Check the length of phone numbers before use

If the phone number string is null or empty, just return
to avoid null exception.

CRs-Fixed: 399293

Change-Id: I78db37d70e38cd2782c13621f98dc25d8624bfb7
parent c82fb00f
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1061,6 +1061,11 @@ public class PhoneNumberUtils
     */
    private static byte[]
    numberToCalledPartyBCDHelper(String number, boolean includeLength) {
        // returns null if number is empty
        if (TextUtils.isEmpty(number)) {
            return null;
        }

        int numberLenReal = number.length();
        int numberLenEffective = numberLenReal;
        boolean hasPlus = number.indexOf('+') != -1;