summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Hui Wang <huiwang@google.com> 2021-09-01 21:07:03 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2021-09-01 21:07:03 +0000
commit915fe99ce4021d1a90e51153b1a216f75b5a868c (patch)
tree8657bfba3f0dd15dc6c9bcd56383888312d0dce8
parent4c76184ee11433627d2e987c1dbb9eaf8fd85fd1 (diff)
parent3cf475553e3933fb1c150cfba3bb57b8ca41b4d9 (diff)
Merge "Check if the slot info is null to avoid exception" into sc-qpr1-dev
-rw-r--r--telephony/java/android/telephony/TelephonyManager.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 255a61266ebf..8f3172a14074 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -3483,7 +3483,8 @@ public class TelephonyManager {
*/
private int getLogicalSlotIndex(int physicalSlotIndex) {
UiccSlotInfo[] slotInfos = getUiccSlotsInfo();
- if (slotInfos != null && physicalSlotIndex >= 0 && physicalSlotIndex < slotInfos.length) {
+ if (slotInfos != null && physicalSlotIndex >= 0 && physicalSlotIndex < slotInfos.length
+ && slotInfos[physicalSlotIndex] != null) {
return slotInfos[physicalSlotIndex].getLogicalSlotIdx();
}