From: David ‘Bombe’ Roden Date: Thu, 17 Jan 2013 05:10:00 +0000 (+0100) Subject: Only create new Sones if create is true. X-Git-Tag: 0.8.5^2~3^2~92 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=b65fce08b56a5d0966e95a602898aaebb6471b4b;p=Sone.git Only create new Sones if create is true. --- diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 4ce7711..8984cdd 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -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); }