From 009e4a14cd18247c6bbe2aac2d808acf250d549f Mon Sep 17 00:00:00 2001 From: Jay Shrauner Date: Fri, 3 Apr 2015 11:08:54 -0700 Subject: Fix NPE in handleAccountSelection Null check mCallList Bug:20064415 Change-Id: I4129eb4fcc8fe8b3eb2c719c544dec20ce51c56c --- .../src/com/android/incallui/InCallPresenter.java | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'InCallUI') diff --git a/InCallUI/src/com/android/incallui/InCallPresenter.java b/InCallUI/src/com/android/incallui/InCallPresenter.java index b98eadaa1..05a05a603 100644 --- a/InCallUI/src/com/android/incallui/InCallPresenter.java +++ b/InCallUI/src/com/android/incallui/InCallPresenter.java @@ -601,19 +601,23 @@ public class InCallPresenter implements CallList.Listener, InCallPhoneListener, } public void handleAccountSelection(PhoneAccountHandle accountHandle, boolean setDefault) { - Call call = mCallList.getWaitingForAccountCall(); - if (call != null) { - String callId = call.getId(); - TelecomAdapter.getInstance().phoneAccountSelected(callId, accountHandle, setDefault); + if (mCallList != null) { + Call call = mCallList.getWaitingForAccountCall(); + if (call != null) { + String callId = call.getId(); + TelecomAdapter.getInstance().phoneAccountSelected(callId, accountHandle, setDefault); + } } } public void cancelAccountSelection() { mAccountSelectionCancelled = true; - Call call = mCallList.getWaitingForAccountCall(); - if (call != null) { - String callId = call.getId(); - TelecomAdapter.getInstance().disconnectCall(callId); + if (mCallList != null) { + Call call = mCallList.getWaitingForAccountCall(); + if (call != null) { + String callId = call.getId(); + TelecomAdapter.getInstance().disconnectCall(callId); + } } } -- cgit v1.2.3