summaryrefslogtreecommitdiff
path: root/src/se/leap/leapclient
diff options
context:
space:
mode:
Diffstat (limited to 'src/se/leap/leapclient')
-rw-r--r--src/se/leap/leapclient/EIP.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/se/leap/leapclient/EIP.java b/src/se/leap/leapclient/EIP.java
index 426f4359..b86a2a4a 100644
--- a/src/se/leap/leapclient/EIP.java
+++ b/src/se/leap/leapclient/EIP.java
@@ -302,7 +302,6 @@ public final class EIP extends IntentService {
ProfileManager vpl = ProfileManager.getInstance(context);
try {
-
if ( name == "first" ) {
name = vpl.getProfiles().iterator().next().mName;
}
@@ -330,9 +329,11 @@ public final class EIP extends IntentService {
// Currently deletes VpnProfile for host, if there already is one, and builds new
ProfileManager vpl = ProfileManager.getInstance(context);
Collection<VpnProfile> profiles = vpl.getProfiles();
- for (VpnProfile p : profiles){
+ for (Iterator<VpnProfile> it = profiles.iterator(); it.hasNext(); ){
+ VpnProfile p = it.next();
try {
if ( p.mName.contains( gateway.getString("host") ) )
+ it.remove();
vpl.removeProfile(context, p);
} catch (JSONException e) {
// TODO Auto-generated catch block