[Settings] Add NPE protection

Bug: 257197354
Test: manual
Change-Id: Icd944feac79acb9cfdefb4f82fe1183b0a0e3218
This commit is contained in:
Zoey Chen
2022-11-18 04:16:05 +00:00
parent 47c0ee6b38
commit 469b708a2a
4 changed files with 21 additions and 7 deletions

View File

@@ -96,7 +96,8 @@ public class MmsMessagePreferenceController extends TelephonyTogglePreferenceCon
@Override
public boolean isChecked() {
return mTelephonyManager.isDataEnabledForApn(ApnSetting.TYPE_MMS);
return mTelephonyManager != null && mTelephonyManager.isDataEnabledForApn(
ApnSetting.TYPE_MMS);
}
private void refreshPreference() {