I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 1ef838b9 authored by str4d's avatar str4d
Browse files

Fixed NPE

parent c672ca05
No related branches found
No related tags found
No related merge requests found
...@@ -173,15 +173,19 @@ public class AddressbookFragment extends ListFragment implements ...@@ -173,15 +173,19 @@ public class AddressbookFragment extends ListFragment implements
inflater.inflate(R.menu.fragment_addressbook_actions, menu); inflater.inflate(R.menu.fragment_addressbook_actions, menu);
mSearchAddressbook = menu.findItem(R.id.action_search_addressbook); mSearchAddressbook = menu.findItem(R.id.action_search_addressbook);
}
@Override
public void onPrepareOptionsMenu(Menu menu) {
// Hide until needed // Hide until needed
if (getRouterContext() == null) { if (getRouterContext() == null) {
mSearchAddressbook.setVisible(false); mSearchAddressbook.setVisible(false);
mAddToAddressbook.setVisibility(View.GONE); if (mAddToAddressbook != null)
mAddToAddressbook.setVisibility(View.GONE);
} }
// Only allow adding to private book // Only allow adding to private book
if (!PRIVATE_BOOK.equals(mBook)) { if (!PRIVATE_BOOK.equals(mBook) && mAddToAddressbook != null) {
mAddToAddressbook.setVisibility(View.GONE); mAddToAddressbook.setVisibility(View.GONE);
mAddToAddressbook = null; mAddToAddressbook = null;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment