From fec0d0b784d3b93ae91577d00ba411d26916875a Mon Sep 17 00:00:00 2001 From: Tyler Gunn Date: Thu, 8 Jan 2015 10:28:45 -0800 Subject: Fixing Null Pointer exception due to uninitialized view reference. Bug indicates a crash occurred when trying to separate a call from a conference call. The exception thrown was due to calling "setText" on mSecondaryCallProviderLabel when it was null. Although I was not able to reproduce this situation, it appears it would be possible for showAndInitializeSecondaryCallInfo to not set the mSecondaryCallProviderLabel reference when then mSecondaryCallName is initially set if the hasProvider flag is false at the time. If hasProvider becomes true in the future since mSecondaryCallName is already initialized, the code to initialize mSecondaryCallProviderLabel would not run, causing the NPE. I have restructured the code to ensure that this type of scenario is handled appropriately. Bug: 18917883 Change-Id: I837d96aad7ed98729490d95beb897b08e1b08365 --- src/com/android/incallui/CallCardFragment.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/com/android/incallui/CallCardFragment.java b/src/com/android/incallui/CallCardFragment.java index 4bc98557..ded88e4a 100644 --- a/src/com/android/incallui/CallCardFragment.java +++ b/src/com/android/incallui/CallCardFragment.java @@ -727,11 +727,12 @@ public class CallCardFragment extends BaseFragment