Skip to content
Snippets Groups Projects
Commit f9dbc38d authored by Thomas Guillem's avatar Thomas Guillem
Browse files

AudioAlbumFragment: fix potential IndexOutOfBoundsException

parent f4b46f16
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,7 @@ import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.PopupMenu;
import android.util.Log;
import android.view.ContextMenu;
import android.view.LayoutInflater;
import android.view.Menu;
......@@ -183,6 +184,10 @@ public class AudioAlbumFragment extends PlaybackServiceFragment implements Adapt
private boolean handleContextItemSelected(MenuItem item, int position) {
int id = item.getItemId();
if (mMediaList.size() <= position) {
Log.e(TAG, "handleContextItemSelected: wrong index. Shouldn't happen !");
return true;
}
if (id == R.id.audio_list_browser_set_song) {
AudioUtil.setRingtone(mMediaList.get(position), getActivity());
......
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