[Android] Audioplayer: sanity check for context actions
Geoffrey Métais
git at videolan.org
Thu Sep 12 16:34:29 CEST 2019
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Sep 11 11:03:34 2019 +0200| [695a96e25a839ced0c8b2ba023f15963cb8d36a3] | committer: Geoffrey Métais
Audioplayer: sanity check for context actions
> https://code.videolan.org/videolan/vlc-android/commit/695a96e25a839ced0c8b2ba023f15963cb8d36a3
---
vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
index c11b64eb5..52bfcb2fc 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
@@ -179,7 +179,7 @@ class AudioPlayer : Fragment(), PlaylistAdapter.IPlayer, TextWatcher, CoroutineS
private val ctxReceiver: CtxActionReceiver = object : CtxActionReceiver {
override fun onCtxAction(position: Int, option: Int) {
- when (option) {
+ if (position in 0 until playlistAdapter.itemCount) when (option) {
CTX_SET_RINGTONE -> AudioUtil.setRingtone(playlistAdapter.getItem(position), requireActivity())
CTX_ADD_TO_PLAYLIST -> {
val mw = playlistAdapter.getItem(position)
More information about the Android
mailing list