Merge "Add null check in displayPreference"

This commit is contained in:
TreeHugger Robot
2018-06-05 18:14:17 +00:00
committed by Android (Google) Code Review
2 changed files with 13 additions and 1 deletions

View File

@@ -190,4 +190,13 @@ public class ZenModeStarredContactsPreferenceControllerTest {
assertThat(contacts.get(i)).isNotNull();
}
}
@Test
public void nullPreference_displayPreference() {
when(mPreferenceScreen.findPreference(mMessagesController.getPreferenceKey()))
.thenReturn(null);
// should not throw a null pointer
mMessagesController.displayPreference(mPreferenceScreen);
}
}