Skip to content

Commit 1362612

Browse files
committed
Only send player started event if there really is a player
1 parent 5c49ba6 commit 1362612

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

app/src/main/java/org/schabi/newpipe/player/helper/PlayerHolder.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,11 @@ public void onServiceConnected(final ComponentName compName, final IBinder servi
192192
startPlayerListener();
193193
// ^ will call listener.onPlayerConnected() down the line if there is an active player
194194

195-
// notify the main activity that binding the service has completed, so that it can
196-
// open the bottom mini-player
197-
NavigationHelper.sendPlayerStartedEvent(localBinder.getService());
195+
if (playerService != null && playerService.getPlayer() != null) {
196+
// notify the main activity that binding the service has completed and that there is
197+
// a player, so that it can open the bottom mini-player
198+
NavigationHelper.sendPlayerStartedEvent(localBinder.getService());
199+
}
198200
}
199201
}
200202

0 commit comments

Comments
 (0)