Skip to content

Commit 49b7194

Browse files
authored
Fix style and add comment about null player
1 parent a7a7dc5 commit 49b7194

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

app/src/main/java/org/schabi/newpipe/player/PlayerService.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -319,11 +319,8 @@ public Player getPlayer() {
319319
public void setPlayerListener(@Nullable final Consumer<Player> listener) {
320320
this.onPlayerStartedOrStopped = listener;
321321
if (listener != null) {
322-
if (player == null) {
323-
listener.accept(null);
324-
} else {
325-
listener.accept(player);
326-
}
322+
// if there is no player, then `null` will be sent here, to ensure the state is synced
323+
listener.accept(player);
327324
}
328325
}
329326
//endregion

0 commit comments

Comments
 (0)