From 9cb4568af413a6bb61511c340b4aad02a2c61667 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Mon, 27 Aug 2012 10:31:01 +0200 Subject: If profiles are broken do not load them, might fix NPE from market console --- src/de/blinkt/openvpn/ProfileManager.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/de/blinkt/openvpn/ProfileManager.java b/src/de/blinkt/openvpn/ProfileManager.java index a40e6fcb..d2e08a97 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) { -- cgit v1.2.3