Add synchronization.
[Sone.git] / src / main / java / net / pterodactylus / sone / data / Sone.java
index a1aa6ee..e5695fa 100644 (file)
@@ -397,8 +397,10 @@ public class Sone implements Fingerprintable, Comparable<Sone> {
         * @return This Sone (for method chaining)
         */
        public synchronized Sone setPosts(Collection<Post> posts) {
-               this.posts.clear();
-               this.posts.addAll(posts);
+               synchronized (this) {
+                       this.posts.clear();
+                       this.posts.addAll(posts);
+               }
                return this;
        }