Fix potential invalid context crash.

master
Greyson Parrelli 2019-10-30 22:30:33 -04:00
parent 544511905a
commit b15e5b4867
2 changed files with 3 additions and 2 deletions

View File

@ -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) {

View File

@ -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);