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

Commit 3cbbf0e8 authored by rheeze's avatar rheeze
Browse files

Telephony: fix null pointer exception

	that could force close phone app
	while inserting/modifying/deleting SIM contacts

Change-Id: I769cb184062c67af0d231c3d903e301c43ded335
parent 8b30f8d8
Loading
Loading
Loading
Loading
+12 −8
Original line number Diff line number Diff line
@@ -1349,21 +1349,25 @@ public class UsimPhoneBookManager extends Handler implements IccConstants {

    public int getEmptyEmailNum_Pbrindex(int pbrindex) {
        int count = 0;
        if (mEmailFlags.get(pbrindex) != null) {
          for (int i = 0; i < mEmailFlags.get(pbrindex).size(); i++) {
              if (0 == mEmailFlags.get(pbrindex).get(i))
                  count++;
          }
        }
        return count;
    }

    public int getEmptyAnrNum_Pbrindex(int pbrindex) {
        int count = 0;
        if (mAnrFlags.get(pbrindex) != null) {
          for (int i = 0; i < mAnrFlags.get(pbrindex).size(); i++) {
              if (0 == mAnrFlags.get(pbrindex).get(i))
                  count++;
          }
          log("getEmptyAnrNum_Pbrindex pbrIndex is: " + pbrindex + " size is: "
                + mEmailFlags.get(pbrindex).size() + ", count is " + count);
                  + mAnrFlags.get(pbrindex).size() + ", count is " + count);
        }
        return count;
    }
}