From 9d1d797be52a41ed9a83790d231fa2e659666aa1 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Thu, 20 Aug 2015 14:44:56 -0700 Subject: Prevent NPE in VoicemailPlaybackPresenter. Bug: 23386856 Change-Id: Ib87184199e8578a1fe3b0a6457b26069673f56ca --- src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java index 7270af787..9319b6ed9 100644 --- a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java +++ b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java @@ -417,9 +417,11 @@ public class VoicemailPlaybackPresenter super(handler); mFetchResultHandler = handler; - mContext.getContentResolver().registerContentObserver( - voicemailUri, false, this); - mFetchResultHandler.postDelayed(this, FETCH_CONTENT_TIMEOUT_MS); + if (mContext != null) { + mContext.getContentResolver().registerContentObserver( + voicemailUri, false, this); + mFetchResultHandler.postDelayed(this, FETCH_CONTENT_TIMEOUT_MS); + } } /** -- cgit v1.2.3