Commit cb9cb1b3 authored by Geoffrey Métais's avatar Geoffrey Métais

Prevent NPE in menu preparation

parent f0004698
...@@ -58,7 +58,8 @@ public abstract class SortableFragment<T extends SortableAdapter> extends MediaB ...@@ -58,7 +58,8 @@ public abstract class SortableFragment<T extends SortableAdapter> extends MediaB
@Override @Override
public void onPrepareOptionsMenu(Menu menu) { public void onPrepareOptionsMenu(Menu menu) {
super.onPrepareOptionsMenu(menu); super.onPrepareOptionsMenu(menu);
menu.findItem(R.id.ml_menu_sortby).setVisible(isSortEnabled()); final MenuItem item = menu.findItem(R.id.ml_menu_sortby);
if (item != null) item.setVisible(isSortEnabled());
UiTools.updateSortTitles(this, menu); UiTools.updateSortTitles(this, menu);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment