Commit 2a3fe34f authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

DirectoryAdapter: fix a crash for IndexOutOfBoundsException

Number 2 on the developer console
parent c37fa949
......@@ -311,6 +311,8 @@ public class DirectoryAdapter extends BaseAdapter {
}
public String getMediaLocation(int position) {
if (position >= mCurrentNode.children.size())
return null;
return LibVLC.getExistingInstance().nativeToURI(
this.mCurrentDir + "/" + mCurrentNode.children.get(position).name
);
......
......@@ -100,6 +100,9 @@ public class DirectoryViewFragment extends SherlockListFragment implements ISort
int id = item.getItemId();
String mediaLocation = mDirectoryAdapter.getMediaLocation(info.position);
if (mediaLocation == null)
return super.onContextItemSelected(item);
if(id == R.id.directory_view_play) {
openMediaFile(info.position);
return true;
......
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