From: David ‘Bombe’ Roden Date: Fri, 18 Nov 2011 18:00:13 +0000 (+0100) Subject: Do not create a new Sone if the ID is obviously invalid. X-Git-Tag: 0.7.4^2~13 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=099ca7d98f1e557191f9e4db97d1c970a53bc062;p=Sone.git Do not create a new Sone if the ID is obviously invalid. Some earlier version introduced a Sone with an empty ID into the system. If this Sone is now requested, it will not be created anymore. --- diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index d3f50a1..09e46b3 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -528,7 +528,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis public Sone getRemoteSone(String id, boolean create) { synchronized (remoteSones) { Sone sone = remoteSones.get(id); - if ((sone == null) && create) { + if ((sone == null) && create && (id != null) && (id.length() == 43)) { sone = new Sone(id); remoteSones.put(id, sone); setSoneStatus(sone, SoneStatus.unknown);