[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

@@ -99,7 +99,7 @@ public class AutoDataSwitchPreferenceController extends TelephonyTogglePreferenc
@Override
public boolean isChecked() {
return mManager.isMobileDataPolicyEnabled(
return mManager != null && mManager.isMobileDataPolicyEnabled(
TelephonyManager.MOBILE_DATA_POLICY_AUTO_DATA_SWITCH);
}