From 4a00f789a5027397e238bf0024aeb1185cf03965 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sun, 20 Nov 2011 21:32:26 +0100 Subject: [PATCH] Ignore invalid Sones when following. --- src/main/java/net/pterodactylus/sone/core/Core.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index b612c74..7098299 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -1061,6 +1061,11 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis */ public void followSone(Sone sone, String soneId) { Validation.begin().isNotNull("Sone", sone).isNotNull("Sone ID", soneId).check(); + Sone followedSone = getSone(soneId); + if (followedSone == null) { + logger.log(Level.INFO, String.format("Ignored Sone with invalid ID: %s", soneId)); + return; + } followSone(sone, getSone(soneId)); } -- 2.7.4