Fix crash when clearing preference screen

Bug: 27892359
Change-Id: I96cd167e8173bf0345c3e186fa11c2e613b63e6f
This commit is contained in:
Jason Monk
2016-03-29 13:21:48 -04:00
parent f19001f2c0
commit 1cb12bbd60

View File

@@ -305,7 +305,7 @@ public abstract class SettingsPreferenceFragment extends InstrumentedPreferenceF
@Override
public void setPreferenceScreen(PreferenceScreen preferenceScreen) {
if (!preferenceScreen.isAttached()) {
if (preferenceScreen != null && !preferenceScreen.isAttached()) {
// Without ids generated, the RecyclerView won't animate changes to the preferences.
preferenceScreen.setShouldUseGeneratedIds(mAnimationAllowed);
}