diff --git a/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java b/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java index 7a77e2c64..d9577ea70 100644 --- a/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java +++ b/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java @@ -75,7 +75,9 @@ public class MessageArchiveService implements OnAdvancedStreamFeaturesLoaded { query = new Query(account, startCatchup, endCatchup); query.reference = reference; } - this.queries.add(query); + synchronized (this.queries) { + this.queries.add(query); + } this.execute(query); }