From 465ae0eabc9ee6afce10dbb53789ead8800d519f Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Tue, 30 Jun 2015 10:52:59 -0700 Subject: Protect against null mView Bug: 22194812 Change-Id: I95e07820ed97d02fe61ee3ceee62c7e76c6f1cb5 --- .../android/dialer/voicemail/VoicemailPlaybackPresenter.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java index 4597d35d0..19f71455d 100644 --- a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java +++ b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java @@ -521,7 +521,9 @@ public class VoicemailPlaybackPresenter mIsPrepared = false; } - mView.onPlaybackError(); + if (mView != null) { + mView.onPlaybackError(); + } mPosition = 0; mIsPlaying = false; @@ -536,7 +538,9 @@ public class VoicemailPlaybackPresenter // Reset the seekbar position to the beginning. mPosition = 0; - mView.setClipPosition(0, mDuration.get()); + if (mView != null) { + mView.setClipPosition(0, mDuration.get()); + } } @Override @@ -610,7 +614,9 @@ public class VoicemailPlaybackPresenter mPosition = mMediaPlayer.getCurrentPosition(); Log.d(TAG, "Paused playback at " + mPosition + "."); - mView.onPlaybackStopped(); + if (mView != null) { + mView.onPlaybackStopped(); + } mAudioManager.abandonAudioFocus(this); mActivity.getWindow().clearFlags(LayoutParams.FLAG_KEEP_SCREEN_ON); -- cgit v1.2.3