Don't update on voicemail fetch if no activity.
The right thing to do is to return early in this case.
This is a theoretical fix for the tagged bug; presuming that this
exception caused code execution to terminate prematurely and delete
the voicemail as it would be expected to.
Bug: 25346075
Change-Id: I643ff4e8abf723f3673b38f5933416730e5d5f9f
diff --git a/src/com/android/dialer/filterednumber/BlockedNumbersFragment.java b/src/com/android/dialer/filterednumber/BlockedNumbersFragment.java
index fa40e26..56f5fcd 100644
--- a/src/com/android/dialer/filterednumber/BlockedNumbersFragment.java
+++ b/src/com/android/dialer/filterednumber/BlockedNumbersFragment.java
@@ -15,6 +15,7 @@
*/
package com.android.dialer.filterednumber;
+import android.app.Activity;
import android.app.ListFragment;
import android.app.LoaderManager;
import android.content.Context;
@@ -195,7 +196,12 @@
@Override
public void onVoicemailStatusFetched(Cursor cursor) {
- final View hideSetting = getActivity().findViewById(R.id.hide_blocked_calls_setting);
+ Activity activity = getActivity();
+ if (activity == null) {
+ return;
+ }
+
+ final View hideSetting = activity.findViewById(R.id.hide_blocked_calls_setting);
if (cursor == null) {
hideSetting.setVisibility(View.GONE);
return;