mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-29 13:17:43 +00:00
Add null check in TelephonyHelper.getAllPhoneNumbers().
This commit is contained in:
parent
6ae658e6fd
commit
ca69a1f4fc
@ -46,6 +46,11 @@ public class TelephonyHelper {
|
|||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
List<SubscriptionInfo> subscriptionInfos = subscriptionManager.getActiveSubscriptionInfoList();
|
List<SubscriptionInfo> subscriptionInfos = subscriptionManager.getActiveSubscriptionInfoList();
|
||||||
|
if (subscriptionInfos == null) {
|
||||||
|
// This happens when there is no SIM card inserted
|
||||||
|
Log.w(LOGGING_TAG, "Could not get SubscriptionInfos");
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
List<Integer> subscriptionIDs = new ArrayList<>(subscriptionInfos.size());
|
List<Integer> subscriptionIDs = new ArrayList<>(subscriptionInfos.size());
|
||||||
for (SubscriptionInfo info : subscriptionInfos) {
|
for (SubscriptionInfo info : subscriptionInfos) {
|
||||||
subscriptionIDs.add(info.getSubscriptionId());
|
subscriptionIDs.add(info.getSubscriptionId());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user