Null check mCheckFrequency before using

b/14091609

Change-Id: I796774b7133ec68382d2580d0b1cde347aa143f8
This commit is contained in:
Tony Mantler 2014-04-16 10:10:38 -07:00
parent 03d600caac
commit 0151a6af62

View File

@ -212,15 +212,21 @@ public class AccountSettingsFragment extends PreferenceFragment
final CharSequence [] syncIntervals =
savedInstanceState.getCharSequenceArray(SAVESTATE_SYNC_INTERVALS);
mCheckFrequency = (ListPreference) findPreference(PREFERENCE_FREQUENCY);
mCheckFrequency.setEntries(syncIntervalStrings);
mCheckFrequency.setEntryValues(syncIntervals);
if (mCheckFrequency != null) {
mCheckFrequency.setEntries(syncIntervalStrings);
mCheckFrequency.setEntryValues(syncIntervals);
}
}
}
public void onSaveInstanceState(Bundle outstate) {
super.onSaveInstanceState(outstate);
outstate.putCharSequenceArray(SAVESTATE_SYNC_INTERVAL_STRINGS, mCheckFrequency.getEntries());
outstate.putCharSequenceArray(SAVESTATE_SYNC_INTERVALS, mCheckFrequency.getEntryValues());
if (mCheckFrequency != null) {
outstate.putCharSequenceArray(SAVESTATE_SYNC_INTERVAL_STRINGS,
mCheckFrequency.getEntries());
outstate.putCharSequenceArray(SAVESTATE_SYNC_INTERVALS,
mCheckFrequency.getEntryValues());
}
}
@Override