File tree Expand file tree Collapse file tree
app/src/main/java/org/schabi/newpipe/player Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4177,9 +4177,15 @@ private void useVideoSource(final boolean videoEnabled) {
41774177
41784178 final int videoRenderIndex = getVideoRendererIndex ();
41794179
4180- // We can safely assume that currentMetadata is not null (otherwise this method isn't
4181- // called) so we can use the requireNonNull method of the Objects class.
4182- final StreamInfo info = Objects .requireNonNull (currentMetadata ).getMetadata ();
4180+ // The current metadata may be null sometimes so we will be not able to execute the
4181+ // block above. Reload the play queue manager in this case.
4182+ if (currentMetadata == null ) {
4183+ reloadPlayQueueManager ();
4184+ setRecovery ();
4185+ return ;
4186+ }
4187+
4188+ final StreamInfo info = currentMetadata .getMetadata ();
41834189
41844190 /* For video streams: we don't want to stream in background the video stream so if the
41854191 video stream played is not a video-only stream and if there is an audio stream available,
You can’t perform that action at this time.
0 commit comments