Add missing player null check

PiperOrigin-RevId: 272654378
This commit is contained in:
andrewlewis 2019-10-03 15:12:21 +01:00 committed by Oliver Woodman
parent 722722d8df
commit 495b418fb1

View file

@ -943,7 +943,7 @@ public class PlayerControlView extends FrameLayout {
// Cancel any pending updates and schedule a new one if necessary.
removeCallbacks(updateProgressAction);
int playbackState = player == null ? Player.STATE_IDLE : player.getPlaybackState();
if (player.isPlaying()) {
if (player != null && player.isPlaying()) {
long mediaTimeDelayMs =
timeBar != null ? timeBar.getPreferredUpdateDelay() : MAX_UPDATE_INTERVAL_MS;