Only create new Sones if create is true.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 17 Jan 2013 05:10:00 +0000 (06:10 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 17 Jan 2013 05:10:00 +0000 (06:10 +0100)
src/main/java/net/pterodactylus/sone/core/Core.java

index 4ce7711..8984cdd 100644 (file)
@@ -362,7 +362,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
        @Override
        public Sone getSone(String id, boolean create) {
                synchronized (sones) {
-                       if (!sones.containsKey(id)) {
+                       if (!sones.containsKey(id) && create) {
                                Sone sone = new Sone(id, false);
                                sones.put(id, sone);
                        }