Fix NPE when adding account but prefManager doesn't exist
Change-Id: Ie7371ba461995bae96ed1d99e224ab7e0d7acc99 Fix: 34219500 Test: make -j40 RunSettingsRoboTests
This commit is contained in:
@@ -286,6 +286,9 @@ public class AccountPreferenceController extends PreferenceController
|
||||
}
|
||||
|
||||
private void updateProfileUi(final UserInfo userInfo) {
|
||||
if (mParent.getPreferenceManager() == null) {
|
||||
return;
|
||||
}
|
||||
final Context context = mContext;
|
||||
final ProfileData profileData = new ProfileData();
|
||||
profileData.userInfo = userInfo;
|
||||
@@ -402,6 +405,10 @@ public class AccountPreferenceController extends PreferenceController
|
||||
}
|
||||
|
||||
private void updateAccountTypes(ProfileData profileData) {
|
||||
if (mParent.getPreferenceManager() == null) {
|
||||
// This could happen if activity is finishing
|
||||
return;
|
||||
}
|
||||
profileData.preferenceGroup.removeAll();
|
||||
if (profileData.userInfo.isEnabled()) {
|
||||
final ArrayList<AccountTypePreference> preferences = getAccountTypePreferences(
|
||||
|
Reference in New Issue
Block a user