Prevent crash

This commit is contained in:
M66B
2019-05-10 18:33:23 +02:00
parent 777da49bf6
commit 51679a61b2
2 changed files with 10 additions and 6 deletions

View File

@@ -63,6 +63,7 @@ import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.constraintlayout.widget.Group;
import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.Lifecycle;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.android.colorpicker.ColorPickerDialog;
@@ -1370,9 +1371,10 @@ public class FragmentAccount extends FragmentBase {
Log.e(ex);
if (ex instanceof OperationCanceledException ||
ex instanceof AuthenticatorException ||
ex instanceof IOException)
Snackbar.make(view, Helper.formatThrowable(ex), Snackbar.LENGTH_LONG).show();
else
ex instanceof IOException) {
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
Snackbar.make(view, Helper.formatThrowable(ex), Snackbar.LENGTH_LONG).show();
} else
Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex);
} finally {
btnAuthorize.setEnabled(true);