Fix possible NPE in game filtering code

This commit is contained in:
Peter Osterlund 2020-02-15 08:56:17 +01:00
parent b354b32bb7
commit aa6ba09675

View File

@ -112,7 +112,7 @@ public class GameAdapter<T> extends BaseAdapter implements Filterable {
@SuppressWarnings("unchecked")
@Override
protected void publishResults(CharSequence constraint, FilterResults results) {
values = (ArrayList<T>) results.values;
values = results == null ? new ArrayList<T>() : (ArrayList<T>) results.values;
notifyDataSetChanged();
}
}