summaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2021-02-26 21:46:43 +0100
committercyBerta <cyberta@riseup.net>2021-02-26 21:46:43 +0100
commitf5ac2b26a9efea7ff2efbf64a1ec1dd3be9e35cf (patch)
tree0a92de0319a9752c51033fd9b8e284e8e793e50b /app/src/main/java
parentf8af21d625c4e732b2079a7814b7b4b03c22cd80 (diff)
catch rare IllegalStateException in EipFragment
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java
index b99182ae..615221ae 100644
--- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java
+++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java
@@ -176,12 +176,18 @@ public class EipFragment extends Fragment implements Observer {
View view = inflater.inflate(R.layout.f_eip, container, false);
unbinder = ButterKnife.bind(this, view);
- Bundle arguments = getArguments();
- if (arguments != null && arguments.containsKey(ASK_TO_CANCEL_VPN) && arguments.getBoolean(ASK_TO_CANCEL_VPN)) {
- arguments.remove(ASK_TO_CANCEL_VPN);
- setArguments(arguments);
- askToStopEIP();
+ try {
+ Bundle arguments = getArguments();
+ if (arguments != null && arguments.containsKey(ASK_TO_CANCEL_VPN) && arguments.getBoolean(ASK_TO_CANCEL_VPN)) {
+ arguments.remove(ASK_TO_CANCEL_VPN);
+ setArguments(arguments);
+ askToStopEIP();
+ }
+ } catch (IllegalStateException e) {
+ // probably setArguments failed because the fragments state is already saved
+ e.printStackTrace();
}
+
restoreFromSavedInstance(savedInstanceState);
return view;
}