diff options
author | Hui Wang <huiwang@google.com> | 2021-08-31 10:49:59 -0700 |
---|---|---|
committer | Hui Wang <huiwang@google.com> | 2021-08-31 20:39:18 +0000 |
commit | 3cf475553e3933fb1c150cfba3bb57b8ca41b4d9 (patch) | |
tree | 48a22da8ef89c0eaf44af3199ae9672bc1b08f8b /telephony/java/android | |
parent | d6af8c55808eac5ab0ee73a85e97f800f81c1da4 (diff) |
Check if the slot info is null to avoid exception
Bug: 198298029
Test: manual
Change-Id: Id5ad70e24ee2ddbb0e4910257e298c33709044a0
Diffstat (limited to 'telephony/java/android')
-rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 3 |
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(); } |