Open ageneric opened 2 years ago
I had the same error occur on NewPipe 0.21.8 using the same device, when restoring an unlisted YouTube video. NewPipe displayed the video on the lock screen (not playing), so the application was open but not visible. Again it crashed immediately when opened.
Note: The crash log is identical apart from the Version field.
java.lang.NullPointerException: Attempt to invoke virtual method 'long org.schabi.newpipe.player.playqueue.PlayQueueItem.getRecoveryPosition()' on a null object reference
at org.schabi.newpipe.fragments.detail.VideoDetailFragment.updateProgressInfo(VideoDetailFragment.java:1644)
at org.schabi.newpipe.fragments.detail.VideoDetailFragment.handleResult(VideoDetailFragment.java:1547)
at org.schabi.newpipe.fragments.detail.VideoDetailFragment.lambda$runWorker$6(VideoDetailFragment.java:893)
at org.schabi.newpipe.fragments.detail.VideoDetailFragment.lambda$runWorker$6$VideoDetailFragment(VideoDetailFragment.java)
at org.schabi.newpipe.fragments.detail.-$$Lambda$VideoDetailFragment$X-UcNln23jPsop2TvHe2VPTu0NQ.accept(lambda)
at io.reactivex.rxjava3.internal.observers.ConsumerSingleObserver.onSuccess(ConsumerSingleObserver.java:62)
at io.reactivex.rxjava3.internal.operators.single.SingleObserveOn$ObserveOnSingleObserver.run(SingleObserveOn.java:81)
at io.reactivex.rxjava3.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:123)
at android.os.Handler.handleCallback(Handler.java:746)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
Note that a similar error now starts occurring on https://github.com/TeamNewPipe/NewPipe/blob/v0.21.9/app/src/main/java/org/schabi/newpipe/player/Player.java#L674
There seems to be a shared underlying cause as the error messages are identical.
In both cases Attempt to invoke virtual method 'long org.schabi.newpipe.player.playqueue.PlayQueueItem.getRecoveryPosition()' on a null object reference
happens because the stream is outside a valid index:
https://github.com/TeamNewPipe/NewPipe/blob/v0.21.9/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java#L169-L187
Seeing this most of the time with latest version.
Kinda fixed if I FC the app and clean cache. On reopen same video just works fine.
Checklist
Purpose
This issue is intended to report the NullPointerException that occurs when
player.playqueue.PlayQueueItem.getRecoveryPosition()
is invoked, and the logs corresponds to this crash. In the initial report the error occurred after a different crash, which is mentioned for the sake of reproducibility (I did not open an issue for this crash as I did not keep the log).Steps to reproduce the bug
The same error has occurred twice, however I am unable to reproduce the bug following either case. In each case the actions leading up to the crash are listed below:
Re-opening an ended live stream (0.21.5, initial report)
*The live stream was set to upload as video after ending.
Re-opening an unlisted video (0.21.8)
*The unlisted video still exists and was not removed.
Actual behavior
On opening NewPipe, NewPipe immediately crashes and brings up the bug reporting screen. In both cases the crash log is identical except for the Version field (but you can find the more recent log in the comment below).
Expected behavior
The video/livestream is re-opened without an error.
Logs
Error on app open following "Could not play stream" toast message and closing app. Produced on non-root Android Marshmallow. Not logged in.
Exception
Crash log
Device info