From 185dac6953894e386502acbe42794b6d62c46f8b Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sun, 7 May 2017 15:47:18 +0200 Subject: [PATCH] synchronize around adding query to query map --- .../siacs/conversations/services/MessageArchiveService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); }