From 592a91317218204f6dedeb47473a1cc7f02dab09 Mon Sep 17 00:00:00 2001 From: Nancy Chen Date: Tue, 23 Jun 2015 16:12:20 -0700 Subject: Fix potential crash if uri is unavailable. If the voicemail is in the process of deleting, the uri may be unavailable after the async task has started executing. Make a null check first. Bug: 21978479 Change-Id: I0ec93e66b055c4e5d9ce2743a3cffc689c835f78 --- src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/com/android') diff --git a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java index 5e75ca7e2..e1ad20b64 100644 --- a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java +++ b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java @@ -337,6 +337,10 @@ public class VoicemailPlaybackPresenter } private boolean queryHasContent(Uri voicemailUri) { + if (voicemailUri == null) { + return false; + } + ContentResolver contentResolver = mContext.getContentResolver(); Cursor cursor = contentResolver.query( voicemailUri, HAS_CONTENT_PROJECTION, null, null, null); -- cgit v1.2.3