App crashes while click on multiple items from history
Steps to produce:
- Open VLC> More> History
- Click on multiple history items at a time (in my case the files cannot be played as all those files deleted already)
- App crashed
Crash logs:
FATAL EXCEPTION: main @coroutine#15
Process: org.videolan.vlc, PID: 3690
java.lang.ArrayIndexOutOfBoundsException: length=5; index=-1
at java.util.ArrayList.get(ArrayList.java:439)
at org.videolan.tools.livedata.LiveDataset.get(LiveDataset.kt:45)
at org.videolan.vlc.gui.MoreFragment.process(MoreFragment.kt:271)
at org.videolan.vlc.gui.MoreFragment.access$process(MoreFragment.kt:71)
at org.videolan.vlc.gui.MoreFragment$onViewCreated$3.invokeSuspend(MoreFragment.kt:121)
at org.videolan.vlc.gui.MoreFragment$onViewCreated$3.invoke(Unknown Source:10)
at kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2.emit(Collect.kt:134)
at kotlinx.coroutines.flow.FlowKt__ChannelsKt.emitAllImpl$FlowKt__ChannelsKt(Channels.kt:61)
at kotlinx.coroutines.flow.FlowKt__ChannelsKt$emitAllImpl$1.invokeSuspend(Unknown Source:11)
at (Coroutine boundary.()
at androidx.lifecycle.PausingDispatcherKt$whenStateAtLeast$2.invokeSuspend(PausingDispatcher.kt:162)
at androidx.lifecycle.LifecycleCoroutineScope$launchWhenStarted$1.invokeSuspend(Lifecycle.kt:87)
Caused by: java.lang.ArrayIndexOutOfBoundsException: length=5; index=-1
at java.util.ArrayList.get(ArrayList.java:439)
at org.videolan.tools.livedata.LiveDataset.get(LiveDataset.kt:45)
at org.videolan.vlc.gui.MoreFragment.process(MoreFragment.kt:271)
at org.videolan.vlc.gui.MoreFragment.access$process(MoreFragment.kt:71)
at org.videolan.vlc.gui.MoreFragment$onViewCreated$3.invokeSuspend(MoreFragment.kt:121)
at org.videolan.vlc.gui.MoreFragment$onViewCreated$3.invoke(Unknown Source:10)
at kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2.emit(Collect.kt:134)
at kotlinx.coroutines.flow.FlowKt__ChannelsKt.emitAllImpl$FlowKt__ChannelsKt(Channels.kt:61)
at kotlinx.coroutines.flow.FlowKt__ChannelsKt$emitAllImpl$1.invokeSuspend(Unknown Source:11)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:227)
at kotlinx.coroutines.DispatchedTaskKt.resumeUnconfined(DispatchedTask.kt:190)
at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:161)
at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:362)
at kotlinx.coroutines.CancellableContinuationImpl.completeResume(CancellableContinuationImpl.kt:479)
at kotlinx.coroutines.channels.AbstractChannel$ReceiveElement.completeResumeReceive(AbstractChannel.kt:899)
at kotlinx.coroutines.channels.ConflatedChannel.offerInternal(ConflatedChannel.kt:56)
at kotlinx.coroutines.channels.AbstractSendChannel.offer(AbstractChannel.kt:141)
at org.videolan.tools.KotlinExtensionsKt.safeOffer(KotlinExtensions.kt:118)
at org.videolan.vlc.gui.HistoryAdapter$ViewHolder.onImageClick(HistoryAdapter.kt:81)
at org.videolan.vlc.databinding.HistoryItemCardBindingImpl$OnClickListenerImpl1.onClick(HistoryItemCardBindingImpl.java:242)
at android.view.View.performClick(View.java:6294)
at android.view.View$PerformClick.run(View.java:24774)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6518)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Device details: Android: 8.1.0 Model: Lenovo Tab4 8 plus (TB-8704X) App version: 3.4.2 (13040207) [F-Droid]MP4_20220101_114541