Fix potential invalid context crash.
parent
544511905a
commit
b15e5b4867
|
@ -128,7 +128,6 @@ public abstract class ContactSelectionActivity extends PassphraseRequiredActionB
|
|||
|
||||
@Override
|
||||
protected Void doInBackground(Context... params) {
|
||||
|
||||
try {
|
||||
DirectoryHelper.refreshDirectory(params[0], true);
|
||||
} catch (IOException e) {
|
||||
|
|
|
@ -284,6 +284,8 @@ public final class ContactSelectionListFragment extends Fragment
|
|||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
private void handleContactPermissionGranted() {
|
||||
final Context context = requireContext();
|
||||
|
||||
new AsyncTask<Void, Void, Boolean>() {
|
||||
@Override
|
||||
protected void onPreExecute() {
|
||||
|
@ -298,7 +300,7 @@ public final class ContactSelectionListFragment extends Fragment
|
|||
@Override
|
||||
protected Boolean doInBackground(Void... voids) {
|
||||
try {
|
||||
DirectoryHelper.refreshDirectory(getContext(), false);
|
||||
DirectoryHelper.refreshDirectory(context, false);
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
Log.w(TAG, e);
|
||||
|
|
Loading…
Reference in New Issue