Check if post belongs to this Sone before trying to delete it.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 14 Oct 2010 08:02:35 +0000 (10:02 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 14 Oct 2010 08:02:35 +0000 (10:02 +0200)
src/main/java/net/pterodactylus/sone/data/Sone.java

index 27c7852..a40b12e 100644 (file)
@@ -236,7 +236,7 @@ public class Sone {
         *            The post to remove
         */
        public synchronized void removePost(Post post) {
-               if (posts.remove(post)) {
+               if (post.getSone().equals(this) && posts.remove(post)) {
                        modificationCounter++;
                }
        }