Fix bug with null pointer exception with conference call
Calls with a null getHandle() were creating a NPE.
Bug: 15618846
Change-Id: Ic33f5e71a0527c907d94baf0adcc1373bbfda99f
diff --git a/src/com/android/telecomm/PhoneStateBroadcaster.java b/src/com/android/telecomm/PhoneStateBroadcaster.java
index f929f1f..d6f1a38 100644
--- a/src/com/android/telecomm/PhoneStateBroadcaster.java
+++ b/src/com/android/telecomm/PhoneStateBroadcaster.java
@@ -60,10 +60,12 @@
intent.putExtra(TelephonyManager.EXTRA_STATE, phoneState);
// Populate both, since the original API was needlessly complicated.
- String callHandle = call.getHandle().getSchemeSpecificPart();
- intent.putExtra(TelephonyManager.EXTRA_INCOMING_NUMBER, callHandle);
- // TODO: See if we can add this (the current API only sets this on NEW_OUTGOING_CALL).
- intent.putExtra(Intent.EXTRA_PHONE_NUMBER, callHandle);
+ if (call.getHandle() != null) {
+ String callHandle = call.getHandle().getSchemeSpecificPart();
+ intent.putExtra(TelephonyManager.EXTRA_INCOMING_NUMBER, callHandle);
+ // TODO: See if we can add this (the current API only sets this on NEW_OUTGOING_CALL).
+ intent.putExtra(Intent.EXTRA_PHONE_NUMBER, callHandle);
+ }
// TODO: Replace these with real constants once this API has been vetted.
CallServiceWrapper callService = call.getCallService();