Check for NPE when creating Bundle
Bug: 28982151
Change-Id: I9f1798ba211de572a3e30a94fcf955984c89fa7d
diff --git a/src/com/android/services/telephony/TelephonyConnection.java b/src/com/android/services/telephony/TelephonyConnection.java
index 6a38985..21c71d2 100644
--- a/src/com/android/services/telephony/TelephonyConnection.java
+++ b/src/com/android/services/telephony/TelephonyConnection.java
@@ -726,8 +726,9 @@
// Post update of extras to the handler; extras are updated via the handler to ensure thread
// safety. The Extras Bundle is cloned in case the original extras are modified while they
// are being added to mOriginalConnectionExtras in updateExtras.
- mHandler.obtainMessage(MSG_CONNECTION_EXTRAS_CHANGED,
- new Bundle(mOriginalConnection.getConnectionExtras())).sendToTarget();
+ Bundle connExtras = mOriginalConnection.getConnectionExtras();
+ mHandler.obtainMessage(MSG_CONNECTION_EXTRAS_CHANGED, connExtras == null ? null :
+ new Bundle(connExtras)).sendToTarget();
if (PhoneNumberUtils.isEmergencyNumber(mOriginalConnection.getAddress())) {
mTreatAsEmergencyCall = true;