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

Commit d4a6cea1 authored by Michael W's avatar Michael W
Browse files

Dialer: Fix possible NPE

* In some cases with VVM involved, the phone number seems to be null,
  resulting in a NPE when trying to split it by the regex
* Make sure there is always a valid string involved to prevent the error

BUGBASH-1447, BUGBASH-1242

Change-Id: I88302deeaeb3e085190fdab5fa7d2a8030bceb88
parent 8d2b1b00
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -507,7 +507,10 @@ public class CallLogAdapter extends GroupingListAdapter
        }

        int count = getGroupSize(position);
        final String phoneNumber = c.getString(CallLogQuery.NUMBER);
        String phoneNumber = c.getString(CallLogQuery.NUMBER);
        if (phoneNumber == null) {
            phoneNumber = "";
        }
        Pattern pattern = Pattern.compile("[,;]");
        String[] num = pattern.split(phoneNumber);
        final String countryIso = c.getString(CallLogQuery.COUNTRY_ISO);