File tree Expand file tree Collapse file tree
app/src/main/java/org/schabi/newpipe/fragments/detail Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -505,12 +505,18 @@ public void onClick(final View v) {
505505 }
506506 break ;
507507 case R .id .detail_thumbnail_root_layout :
508- autoPlayEnabled = true ; // forcefully start playing
509- // FIXME Workaround #7427
510- if (isPlayerAvailable ()) {
511- player .setRecovery ();
508+ // make sure not to open any player if there is nothing currently loaded!
509+ // FIXME removing this `if` causes the player service to start correctly, then stop,
510+ // then restart badly without calling `startForeground()`, causing a crash when
511+ // later closing the detail fragment
512+ if (currentInfo != null ) {
513+ autoPlayEnabled = true ; // forcefully start playing
514+ // FIXME Workaround #7427
515+ if (isPlayerAvailable ()) {
516+ player .setRecovery ();
517+ }
518+ openVideoPlayerAutoFullscreen ();
512519 }
513- openVideoPlayerAutoFullscreen ();
514520 break ;
515521 case R .id .detail_title_root_layout :
516522 toggleTitleAndSecondaryControls ();
You can’t perform that action at this time.
0 commit comments