Merge "Add more logs around setConferenceHost"
diff --git a/src/com/android/services/telephony/TelephonyConnection.java b/src/com/android/services/telephony/TelephonyConnection.java
index 0c0cafa..983351f 100755
--- a/src/com/android/services/telephony/TelephonyConnection.java
+++ b/src/com/android/services/telephony/TelephonyConnection.java
@@ -1574,12 +1574,13 @@
         boolean wasVideoCall = false;
         boolean isVowifiEnabled = false;
         if (phone instanceof ImsPhone) {
-            ImsPhone imsPhone = (ImsPhone) phone;
-            if (imsPhone.getForegroundCall() != null
-                    && imsPhone.getForegroundCall().getImsCall() != null) {
-                ImsCall call = imsPhone.getForegroundCall().getImsCall();
-                isCurrentVideoCall = call.isVideoCall();
-                wasVideoCall = call.wasVideoCall();
+            ImsPhoneCall foregroundCall = ((ImsPhone) phone).getForegroundCall();
+            if (foregroundCall != null) {
+                ImsCall call = foregroundCall.getImsCall();
+                if (call != null) {
+                    isCurrentVideoCall = call.isVideoCall();
+                    wasVideoCall = call.wasVideoCall();
+                }
             }
 
             isVowifiEnabled = ImsUtil.isWfcEnabled(phone.getContext(), phone.getPhoneId());