diff options
author | Jay Shrauner <shrauner@google.com> | 2015-10-12 16:34:56 -0700 |
---|---|---|
committer | Yorke Lee <yorkelee@google.com> | 2015-10-20 09:38:59 -0700 |
commit | f4b1101e5831faa5407e44566185007788090dce (patch) | |
tree | 32655a290df611143bab65ec89281553af67c9ac /src/com/android/dialer/voicemail | |
parent | ccf6c7a8b3da1da6bf9df41e18485ddc08a5a17a (diff) |
Fix NPE in requestContent
Check for null context in resumePlayback.
Bug:24858686
Change-Id: I7c65e3ae836535f15936ecb397a68ee6590f31ed
Diffstat (limited to 'src/com/android/dialer/voicemail')
-rw-r--r-- | src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java index 9319b6ed9..ed6cc8b43 100644 --- a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java +++ b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java @@ -587,6 +587,10 @@ public class VoicemailPlaybackPresenter * playing. */ public void resumePlayback() { + if (mView == null || mContext == null) { + return; + } + if (!mIsPrepared) { // If we haven't downloaded the voicemail yet, attempt to download it. checkForContent(); @@ -597,7 +601,7 @@ public class VoicemailPlaybackPresenter mIsPlaying = true; - if (!mMediaPlayer.isPlaying()) { + if (mMediaPlayer != null && !mMediaPlayer.isPlaying()) { // Clamp the start position between 0 and the duration. mPosition = Math.max(0, Math.min(mPosition, mDuration.get())); mMediaPlayer.seekTo(mPosition); |