Fix random NullPointerException in SearchFragment
This commit is contained in:
parent
9f59d4baa3
commit
be4d12789d
|
@ -139,7 +139,7 @@ public class SearchFragment extends BaseListFragment<SearchInfo, ListExtractor.I
|
||||||
@State
|
@State
|
||||||
boolean wasSearchFocused = false;
|
boolean wasSearchFocused = false;
|
||||||
|
|
||||||
private Map<Integer, String> menuItemToFilterName;
|
@Nullable private Map<Integer, String> menuItemToFilterName = null;
|
||||||
private StreamingService service;
|
private StreamingService service;
|
||||||
private Page nextPage;
|
private Page nextPage;
|
||||||
private boolean isSuggestionsEnabled = true;
|
private boolean isSuggestionsEnabled = true;
|
||||||
|
@ -455,11 +455,12 @@ public class SearchFragment extends BaseListFragment<SearchInfo, ListExtractor.I
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(final MenuItem item) {
|
public boolean onOptionsItemSelected(@NonNull final MenuItem item) {
|
||||||
final List<String> cf = new ArrayList<>(1);
|
if (menuItemToFilterName != null) {
|
||||||
cf.add(menuItemToFilterName.get(item.getItemId()));
|
final List<String> cf = new ArrayList<>(1);
|
||||||
changeContentFilter(item, cf);
|
cf.add(menuItemToFilterName.get(item.getItemId()));
|
||||||
|
changeContentFilter(item, cf);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue