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

Commit 67205edb authored by Bai Tao's avatar Bai Tao
Browse files

Fix NPE caused by the selected entry is not valid when make a phone call

Change-Id: Ifc974f43be4e58ca69f150a29d4b7e9a0670f08f
parent 38ce75cc
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -715,17 +715,20 @@ public class ViewContactActivity extends Activity
                int index = mListView.getSelectedItemPosition();
                if (index != -1) {
                    ViewEntry entry = ViewAdapter.getEntry(mSections, index, SHOW_SEPARATORS);
                    if (entry.intent.getAction() == Intent.ACTION_CALL_PRIVILEGED) {
                    if (entry != null &&
                            entry.intent.getAction() == Intent.ACTION_CALL_PRIVILEGED) {
                        startActivity(entry.intent);
                        return true;
                    }
                } else if (mPrimaryPhoneUri != null) {
                    // There isn't anything selected, call the default number
                    final Intent intent = new Intent(Intent.ACTION_CALL_PRIVILEGED,
                            mPrimaryPhoneUri);
                    startActivity(intent);
                }
                    return true;
                }
                return false;
            }

            case KeyEvent.KEYCODE_DEL: {
                if (mReadOnlySourcesCnt > 0 & mWritableSourcesCnt > 0) {