Fix crash in SubscriptionInfoHelper for null display name.
Test: Add unit test for this case
Bug: 198728993
Change-Id: I3b13843f5229489d3d0625ab7a723f6c7aa1b913
diff --git a/src/com/android/phone/SubscriptionInfoHelper.java b/src/com/android/phone/SubscriptionInfoHelper.java
index 7c373e0..14faebc 100644
--- a/src/com/android/phone/SubscriptionInfoHelper.java
+++ b/src/com/android/phone/SubscriptionInfoHelper.java
@@ -91,7 +91,8 @@
intent.putExtra(SubscriptionInfoHelper.SUB_ID_EXTRA, subscription.getSubscriptionId());
intent.putExtra(
- SubscriptionInfoHelper.SUB_LABEL_EXTRA, subscription.getDisplayName().toString());
+ SubscriptionInfoHelper.SUB_LABEL_EXTRA, subscription.getDisplayName() == null ? null
+ : subscription.getDisplayName().toString());
}
/**