summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2013-04-01 16:37:24 +0200
committerArne Schwabe <arne@rfc2549.org>2013-04-01 16:37:24 +0200
commitb993030dbe9b82f27dfce9d812f45c93fbe3c996 (patch)
tree6159c56e0b4b3c23d7b5d4369b68c66654952481
parent27ab1f2c4615cb395d6870cff21288e9e0e5a2c2 (diff)
Ignore error when unregistering network state listener
-rw-r--r--src/de/blinkt/openvpn/core/OpenVpnService.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/de/blinkt/openvpn/core/OpenVpnService.java b/src/de/blinkt/openvpn/core/OpenVpnService.java
index 53d4784b..1b25c28a 100644
--- a/src/de/blinkt/openvpn/core/OpenVpnService.java
+++ b/src/de/blinkt/openvpn/core/OpenVpnService.java
@@ -232,7 +232,14 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
synchronized void unregisterNetworkStateReceiver() {
if(mNetworkStateReceiver!=null)
- this.unregisterReceiver(mNetworkStateReceiver);
+ try {
+ this.unregisterReceiver(mNetworkStateReceiver);
+ } catch (IllegalArgumentException iae) {
+ // I don't know why this happens:
+ // java.lang.IllegalArgumentException: Receiver not registered: de.blinkt.openvpn.NetworkSateReceiver@41a61a10
+ // Ignore for now ...
+ iae.printStackTrace();
+ }
mNetworkStateReceiver=null;
}