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

Prevent NPE if activity is null

parent 0c6edc1d
......@@ -330,9 +330,10 @@ public class NetworkFragment extends BrowserFragment implements IRefreshable, Me
};
private void focusHelper(boolean idIsEmpty) {
View parent = View.inflate(getActivity(),
R.layout.directory_view, null);
if (getActivity() == null)
return;
MainActivity main = (MainActivity)getActivity();
View parent = View.inflate(main, R.layout.directory_view, null);
main.setMenuFocusDown(idIsEmpty, R.id.network_list);
main.setSearchAsFocusDown(idIsEmpty, parent, R.id.network_list);
}
......
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