Skip to content

Commit

Permalink
Do not use let for nullability check to save indentation space
Browse files Browse the repository at this point in the history
  • Loading branch information
123mpozzi committed Nov 7, 2024
1 parent 6d62572 commit b12d6b0
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,17 @@ class RNPlayerView(
// remove player from view so it does not get paused when entering background
private fun removePlayerForBackgroundPlayback() {
playerInMediaSessionService = null
playerView?.player?.let {
if (!enableBackgroundPlayback) {
return
}
if (context.playerModule?.mediaSessionPlaybackManager?.player != it) {
return
}

playerInMediaSessionService = it
playerView?.player = null
val player = playerView?.player ?: return

if (!enableBackgroundPlayback) {
return
}
if (context.playerModule?.mediaSessionPlaybackManager?.player != player) {
return
}

playerInMediaSessionService = player
playerView?.player = null
}
}

Expand Down

0 comments on commit b12d6b0

Please sign in to comment.