TextBeeUtils.getAvailableSimSlots() returns the subscription list without a null check:
public static List<SubscriptionInfo> getAvailableSimSlots(Context context) {
if (ActivityCompat.checkSelfPermission(context, Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) {
return new ArrayList<>();
}
SubscriptionManager subscriptionManager = SubscriptionManager.from(context);
return subscriptionManager.getActiveSubscriptionInfoList();
}
getActiveSubscriptionInfoList() is documented to return null when there are no active subscriptions: no SIM inserted, wifi-only tablet, SIM disabled. Both call sites then break on the null:
- activities/MainActivity.java calls .forEach(...) on the result. The NPE gets caught by the broad catch (Exception e) further down and surfaces to the user as a snackbar that literally reads Error: null, with no SIM options rendered.
- ui/settings/SettingsViewModel.kt maps over it, the exception is swallowed by catch (e: Exception) { emptyList() }, and the SIM selector is silently empty with no explanation.
The two sibling methods in the same file (collectSimInfo and isValidSubscriptionId) already null-check this exact call, so this one looks like an oversight. Fix is to coalesce the null to an empty list.
android/app/src/main/java/com/vernu/sms/TextBeeUtils.java, line 38.
Reactions are currently unavailable
TextBeeUtils.getAvailableSimSlots() returns the subscription list without a null check:
getActiveSubscriptionInfoList() is documented to return null when there are no active subscriptions: no SIM inserted, wifi-only tablet, SIM disabled. Both call sites then break on the null:
The two sibling methods in the same file (collectSimInfo and isValidSubscriptionId) already null-check this exact call, so this one looks like an oversight. Fix is to coalesce the null to an empty list.
android/app/src/main/java/com/vernu/sms/TextBeeUtils.java, line 38.