Don’t let a Sone add itself as friend!
[Sone.git] / src / main / java / net / pterodactylus / sone / data / Sone.java
index 7041289..cd9239e 100644 (file)
@@ -197,7 +197,7 @@ public class Sone {
         * @return This Sone (for method chaining)
         */
        public synchronized Sone addFriend(Sone friendSone) {
-               if (friendSones.add(friendSone)) {
+               if (!friendSone.equals(this) && friendSones.add(friendSone)) {
                        modificationCounter++;
                }
                return this;