Add a null check in an AutoCompleteTextView callback to prevent a crash.
It looks like the drop down list had already been taken down before the callback fired so it caused a null pointer exception. In this case just do nothing instead. Bug 1927858
This commit is contained in:
@@ -1202,7 +1202,11 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe
|
||||
int position, long id) {
|
||||
|
||||
if (position != -1) {
|
||||
mDropDownList.mListSelectionHidden = false;
|
||||
DropDownListView dropDownList = mDropDownList;
|
||||
|
||||
if (dropDownList != null) {
|
||||
dropDownList.mListSelectionHidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user