mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-30 05:44:51 +02:00
Prevent crash
This commit is contained in:
@@ -59,6 +59,7 @@ import androidx.lifecycle.Lifecycle;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
public class FragmentOptionsConnection extends FragmentBase implements SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
private View view;
|
||||
private ImageButton ibHelp;
|
||||
private SwitchCompat swMetered;
|
||||
private Spinner spDownload;
|
||||
@@ -101,7 +102,7 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
|
||||
setSubtitle(R.string.title_setup);
|
||||
setHasOptionsMenu(true);
|
||||
|
||||
View view = inflater.inflate(R.layout.fragment_options_connection, container, false);
|
||||
view = inflater.inflate(R.layout.fragment_options_connection, container, false);
|
||||
|
||||
// Get controls
|
||||
|
||||
@@ -403,9 +404,7 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
|
||||
}
|
||||
|
||||
private void setOptions() {
|
||||
if (getContext() == null)
|
||||
return;
|
||||
if (getLifecycle().getCurrentState().equals(Lifecycle.State.DESTROYED))
|
||||
if (view == null || getContext() == null)
|
||||
return;
|
||||
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
|
||||
Reference in New Issue
Block a user