Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Playback errors when playlist is empty. #3116

Closed
3 tasks done
Qaz-7 opened this issue Feb 18, 2023 · 1 comment · Fixed by #3131
Closed
3 tasks done

Playback errors when playlist is empty. #3116

Qaz-7 opened this issue Feb 18, 2023 · 1 comment · Fixed by #3131
Labels
bug Something isn't working

Comments

@Qaz-7
Copy link

Qaz-7 commented Feb 18, 2023

Steps to reproduce

The playlist is empty.
A) Press the shuffle button.
Error
B) Press the play in the background button.
Error

Expected behavior

There should be no error.

Actual behavior

A) java.util.NoSuchElementException: List is empty.
at kotlin.collections.CollectionsKt___CollectionsKt.first(_Collections.kt:214)
at com.github.libretube.ui.fragments.PlaylistFragment$fetchPlaylist$1$1.invoke$lambda$4(PlaylistFragment.kt:172)
at com.github.libretube.ui.fragments.PlaylistFragment$fetchPlaylist$1$1.$r8$lambda$DR9ViO9HGGdDKYD5S5c30mo4Ung(Unknown Source:0)
at com.github.libretube.ui.fragments.PlaylistFragment$fetchPlaylist$1$1$$ExternalSyntheticLambda4.onClick(Unknown Source:2)
at android.view.View.performClick(View.java:7792)
at android.widget.TextView.performClick(TextView.java:16112)
at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:1202)
at android.view.View.performClickInternal(View.java:7769)
at android.view.View.access$3800(View.java:910)
at android.view.View$PerformClick.run(View.java:30218)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)

B) java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.get(ArrayList.java:437)
at com.github.libretube.ui.sheets.PlaylistOptionsBottomSheet$onCreate$1$1.invokeSuspend(PlaylistOptionsBottomSheet.kt:62)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:284)
at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source:1)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source:1)
at com.github.libretube.ui.sheets.PlaylistOptionsBottomSheet$onCreate$1.invoke(PlaylistOptionsBottomSheet.kt:58)
at com.github.libretube.ui.sheets.PlaylistOptionsBottomSheet$onCreate$1.invoke(PlaylistOptionsBottomSheet.kt:54)
at com.github.libretube.ui.sheets.BaseBottomSheet$setSimpleItems$1$2.invoke(BaseBottomSheet.kt:44)
at com.github.libretube.ui.sheets.BaseBottomSheet$setSimpleItems$1$2.invoke(BaseBottomSheet.kt:43)
at com.github.libretube.ui.adapters.BottomSheetAdapter.onBindViewHolder$lambda$1$lambda$0(BottomSheetAdapter.kt:33)
at com.github.libretube.ui.adapters.BottomSheetAdapter.$r8$lambda$8QByGHFWfpM7z2yaQ_WJfR8ORoE(Unknown Source:0)
at com.github.libretube.ui.adapters.BottomSheetAdapter$$ExternalSyntheticLambda0.onClick(Unknown Source:6)
at android.view.View.performClick(View.java:7792)
at android.widget.TextView.performClick(TextView.java:16112)
at android.view.View.performClickInternal(View.java:7769)
at android.view.View.access$3800(View.java:910)
at android.view.View$PerformClick.run(View.java:30218)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)

LibreTube version

0.12.0 Latest Debug

Android version

Android 12

Other details

XRecorder_18022023_161739.mp4

Acknowledgements

  • I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open issue.
  • I have written a short but informative title.
  • I will fill out all of the requested information in this form.
@Qaz-7 Qaz-7 added the bug Something isn't working label Feb 18, 2023
@Qaz-7
Copy link
Author

Qaz-7 commented Feb 18, 2023

A and B are separate errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant