Commit f0626baf authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Prevent NPE in browser menu

parent 83dd9589
......@@ -114,8 +114,10 @@ public abstract class BaseBrowserFragment extends MediaBrowserFragment<BrowserPr
@Override
public void onPrepareOptionsMenu(Menu menu) {
super.onPrepareOptionsMenu(menu);
menu.findItem(R.id.ml_menu_filter).setVisible(enableSearchOption());
menu.findItem(R.id.ml_menu_sortby).setVisible(!mRoot);
final MenuItem item = menu.findItem(R.id.ml_menu_filter);
if (item != null) item.setVisible(enableSearchOption());
final MenuItem sortItem = menu.findItem(R.id.ml_menu_sortby);
if (sortItem != null) sortItem.setVisible(!mRoot);
}
protected boolean defineIsRoot() {
......
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