Fix crash from Settings Search
Security Settings was returning a search indexable resource without an xml resource (in this case id = 0). Settings search did not handle this exception and crashed. This patch catches the exception, and adds a TODO to fix the indexing in security settings. Change-Id: Ic7f05c98d99cc45fbebbdc672c7e346c27daa0f0 Fixes: 67967367 Test: robotests
This commit is contained in:
@@ -334,6 +334,17 @@ public class IndexDataConverterTest {
|
||||
assertThat(nonTitlePref.enabled).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testResourceWithoutXml_shouldNotCrash() {
|
||||
final SearchIndexableResource resource = getFakeResource(0);
|
||||
final PreIndexData preIndexData = new PreIndexData();
|
||||
preIndexData.dataToUpdate.add(resource);
|
||||
|
||||
List<IndexData> indexData = mConverter.convertPreIndexDataToIndexData(preIndexData);
|
||||
|
||||
assertThat(indexData).isEmpty();
|
||||
}
|
||||
|
||||
private void assertDisplaySetting(IndexData row, String title, String summaryOn,
|
||||
String summaryOff, String key) {
|
||||
assertThat(row.normalizedTitle).isEqualTo(title);
|
||||
|
||||
Reference in New Issue
Block a user