From 099ca7d98f1e557191f9e4db97d1c970a53bc062 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 18 Nov 2011 19:00:13 +0100 Subject: [PATCH] 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. --- src/main/java/net/pterodactylus/sone/core/Core.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.7.4