From 29c0c3eeb07d77c6a0b00cb42c82897148d4732d Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Tue, 27 Jan 2015 23:11:36 +0100 Subject: Log an exception when Android return null on establishtun --- main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'main/src') diff --git a/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java b/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java index 41306db8..81dea416 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java +++ b/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java @@ -612,7 +612,10 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac try { //Debug.stopMethodTracing(); - return builder.establish(); + ParcelFileDescriptor tun = builder.establish(); + if (tun==null) + throw new NullPointerException("Android establish() method returned null (Really broken network configuration?)"); + return tun; } catch (Exception e) { VpnStatus.logError(R.string.tun_open_error); VpnStatus.logError(getString(R.string.error) + e.getLocalizedMessage()); -- cgit v1.2.3