diff options
author | Yorke Lee <yorkelee@google.com> | 2013-09-26 12:09:15 -0700 |
---|---|---|
committer | Yorke Lee <yorkelee@google.com> | 2013-09-26 12:09:15 -0700 |
commit | ff1ca1369f3d9469bd770903dcc2b23edb727973 (patch) | |
tree | 9b84668a0a7d4405203a7b9c0a2f6574515cd19f | |
parent | 5bd7192b2208f2db47af9982469e55440d015c32 (diff) |
Fix potential NPE in ConferenceManagerPresenter
Bug: 10931593
Change-Id: I2b86ca5e7883bed86c978af0589d8865214f27c8
-rw-r--r-- | InCallUI/src/com/android/incallui/ConferenceManagerPresenter.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/InCallUI/src/com/android/incallui/ConferenceManagerPresenter.java b/InCallUI/src/com/android/incallui/ConferenceManagerPresenter.java index 041614db6..d0f62d78b 100644 --- a/InCallUI/src/com/android/incallui/ConferenceManagerPresenter.java +++ b/InCallUI/src/com/android/incallui/ConferenceManagerPresenter.java @@ -21,6 +21,7 @@ import android.content.Context; import com.android.incallui.ContactInfoCache.ContactCacheEntry; import com.android.incallui.InCallPresenter.InCallState; import com.android.incallui.InCallPresenter.InCallStateListener; +import com.android.services.telephony.common.Call; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableSortedSet; @@ -57,11 +58,13 @@ public class ConferenceManagerPresenter public void onStateChange(InCallState state, CallList callList) { if (getUi().isFragmentVisible()) { Log.v(this, "onStateChange" + state); - if (state == InCallState.INCALL && callList.getActiveOrBackgroundCall() != null && - callList.getActiveOrBackgroundCall().isConferenceCall()) { - Log.v(this, "Number of existing calls is " + - String.valueOf(callList.getActiveCall().getChildCallIds().size())); - update(callList); + if (state == InCallState.INCALL) { + final Call call = callList.getActiveOrBackgroundCall(); + if (call != null && call.isConferenceCall()) { + Log.v(this, "Number of existing calls is " + + String.valueOf(call.getChildCallIds().size())); + update(callList); + } } else { getUi().setVisible(false); } |