summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2012-08-27 10:31:01 +0200
committerArne Schwabe <arne@rfc2549.org>2012-08-27 10:31:01 +0200
commit729ca85dec853e69293e9b24789bd2cc64b810c4 (patch)
tree013bf757eea261ce0cc5461bfb56fc29aa102f1d /src/de/blinkt/openvpn
parente365f3616c84d5f0682f25eda188afc91b6cee31 (diff)
If profiles are broken do not load them, might fix NPE from market console
Diffstat (limited to 'src/de/blinkt/openvpn')
-rw-r--r--src/de/blinkt/openvpn/ProfileManager.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/de/blinkt/openvpn/ProfileManager.java b/src/de/blinkt/openvpn/ProfileManager.java
index a40e6fc..d2e08a9 100644
--- a/src/de/blinkt/openvpn/ProfileManager.java
+++ b/src/de/blinkt/openvpn/ProfileManager.java
@@ -160,6 +160,10 @@ public class ProfileManager {
ObjectInputStream vpnfile = new ObjectInputStream(context.openFileInput(vpnentry + ".vp"));
VpnProfile vp = ((VpnProfile) vpnfile.readObject());
+ // Sanity check
+ if(vp==null || vp.mName==null || vp.getUUID()==null)
+ continue;
+
profiles.put(vp.getUUID().toString(), vp);
} catch (StreamCorruptedException e) {