From: David ‘Bombe’ Roden Date: Thu, 14 Oct 2010 08:02:35 +0000 (+0200) Subject: Check if post belongs to this Sone before trying to delete it. X-Git-Tag: 0.1-RC1~422 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=ec41f5f45fe6f31bfec77ca9b41c9bf60bfcd5dc;p=Sone.git Check if post belongs to this Sone before trying to delete it. --- diff --git a/src/main/java/net/pterodactylus/sone/data/Sone.java b/src/main/java/net/pterodactylus/sone/data/Sone.java index 27c7852..a40b12e 100644 --- a/src/main/java/net/pterodactylus/sone/data/Sone.java +++ b/src/main/java/net/pterodactylus/sone/data/Sone.java @@ -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++; } }