1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-05-04 16:34:09 +00:00

Fix style and add comment about null player

This commit is contained in:
Stypox 2025-02-24 14:21:05 +01:00 committed by GitHub
parent a7a7dc5363
commit 49b71942ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -319,13 +319,10 @@ public final class PlayerService extends MediaBrowserServiceCompat {
public void setPlayerListener(@Nullable final Consumer<Player> listener) {
this.onPlayerStartedOrStopped = listener;
if (listener != null) {
if (player == null) {
listener.accept(null);
} else {
// if there is no player, then `null` will be sent here, to ensure the state is synced
listener.accept(player);
}
}
}
//endregion
//region Media browser