From: David ‘Bombe’ Roden Date: Sun, 20 Nov 2011 20:32:26 +0000 (+0100) Subject: Ignore invalid Sones when following. X-Git-Tag: 0.7.4^2~8 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=4a00f789a5027397e238bf0024aeb1185cf03965;p=Sone.git Ignore invalid Sones when following. --- 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)); }