Synchronize all access on the current own identities.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 26 Jun 2014 18:21:14 +0000 (20:21 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 26 Jun 2014 18:21:14 +0000 (20:21 +0200)
src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManager.java

index 9f9ab7f..6f33a4a 100644 (file)
@@ -150,7 +150,9 @@ public class IdentityManager extends AbstractService {
         * @return All own identities
         */
        public Set<OwnIdentity> getAllOwnIdentities() {
-               return new HashSet<OwnIdentity>(currentOwnIdentities.values());
+               synchronized (syncObject) {
+                       return new HashSet<OwnIdentity>(currentOwnIdentities.values());
+               }
        }
 
        //