mirror of
https://github.com/oxen-io/session-android.git
synced 2025-06-09 08:08: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
|
@Override
|
||||||
protected Void doInBackground(Context... params) {
|
protected Void doInBackground(Context... params) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
DirectoryHelper.refreshDirectory(params[0], true);
|
DirectoryHelper.refreshDirectory(params[0], true);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
@ -284,6 +284,8 @@ public final class ContactSelectionListFragment extends Fragment
|
|||||||
|
|
||||||
@SuppressLint("StaticFieldLeak")
|
@SuppressLint("StaticFieldLeak")
|
||||||
private void handleContactPermissionGranted() {
|
private void handleContactPermissionGranted() {
|
||||||
|
final Context context = requireContext();
|
||||||
|
|
||||||
new AsyncTask<Void, Void, Boolean>() {
|
new AsyncTask<Void, Void, Boolean>() {
|
||||||
@Override
|
@Override
|
||||||
protected void onPreExecute() {
|
protected void onPreExecute() {
|
||||||
@ -298,7 +300,7 @@ public final class ContactSelectionListFragment extends Fragment
|
|||||||
@Override
|
@Override
|
||||||
protected Boolean doInBackground(Void... voids) {
|
protected Boolean doInBackground(Void... voids) {
|
||||||
try {
|
try {
|
||||||
DirectoryHelper.refreshDirectory(getContext(), false);
|
DirectoryHelper.refreshDirectory(context, false);
|
||||||
return true;
|
return true;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log.w(TAG, e);
|
Log.w(TAG, e);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user