mirror of
https://github.com/oxen-io/session-android.git
synced 2025-06-08 22:58:33 +00:00
Fix potential invalid context crash.
This commit is contained in:
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…
x
Reference in New Issue
Block a user