Commit 3b3b3aeb authored by Edward Wang's avatar Edward Wang
Browse files

src: Prevent NullPointerException in DirectoryViewFragment.onContextItemSelected()

AdapterContextMenuInfo can be null sometimes, according to the documentation.

parent 9eb9494e
......@@ -95,6 +95,9 @@ public class DirectoryViewFragment extends SherlockListFragment implements ISort
public boolean onContextItemSelected(MenuItem item) {
AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
if(info == null) // info can be null
return super.onContextItemSelected(item);
int id = item.getItemId();
String mediaLocation = mDirectoryAdapter.getMediaLocation(info.position);
if(id == {
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