Use a boolean instead of abusing ownIdentities.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 6 May 2011 21:34:00 +0000 (23:34 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 6 May 2011 21:34:00 +0000 (23:34 +0200)
src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManager.java

index acd8633..3c97e55 100644 (file)
@@ -181,6 +181,7 @@ public class IdentityManager extends AbstractService {
                        Map<String, OwnIdentity> currentOwnIdentities = new HashMap<String, OwnIdentity>();
 
                        Set<OwnIdentity> ownIdentities = null;
+                       boolean identitiesLoaded = false;
                        try {
                                /* get all identities with the wanted context from WoT. */
                                ownIdentities = webOfTrustConnector.loadAllOwnIdentities();
@@ -199,12 +200,12 @@ public class IdentityManager extends AbstractService {
                                                identities.put(identity.getId(), identity);
                                        }
                                }
+                               identitiesLoaded = true;
                        } catch (WebOfTrustException wote1) {
                                logger.log(Level.WARNING, "WoT has disappeared!", wote1);
-                               ownIdentities = null;
                        }
 
-                       if (ownIdentities != null) {
+                       if (identitiesLoaded) {
 
                                /* check for changes. */
                                checkOwnIdentities(currentOwnIdentities);