From cda290995783e09079df80a0ca5279887d5f37e1 Mon Sep 17 00:00:00 2001 From: erfanian Date: Thu, 21 Jun 2018 14:32:06 -0700 Subject: Use context only after it is available. Bug: 88003605 Test: Not possible; robo does not support a widget and the test suite is disabled. PiperOrigin-RevId: 201587545 Change-Id: I3683cb5649f9384c63e2156c67a38b3ff31675d7 --- java/com/android/dialer/searchfragment/list/NewSearchFragment.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'java') diff --git a/java/com/android/dialer/searchfragment/list/NewSearchFragment.java b/java/com/android/dialer/searchfragment/list/NewSearchFragment.java index 5417fcf8c..fd6db75e9 100644 --- a/java/com/android/dialer/searchfragment/list/NewSearchFragment.java +++ b/java/com/android/dialer/searchfragment/list/NewSearchFragment.java @@ -275,7 +275,8 @@ public final class NewSearchFragment extends Fragment return false; } - if (PermissionsUtil.hasLocationPermissions(getContext()) + if (getContext() == null + || PermissionsUtil.hasLocationPermissions(getContext()) || hasBeenDismissed() || !isRegularSearch()) { adapter.hideLocationPermissionRequest(); -- cgit v1.2.3