From 36b572fa5f369945bf5ed23d80433d0bd95193b5 Mon Sep 17 00:00:00 2001 From: cketti Date: Sat, 3 Nov 2012 04:25:40 +0100 Subject: [PATCH] Fix deleteThreadsSynchronous() --- src/com/fsck/k9/controller/MessagingController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/com/fsck/k9/controller/MessagingController.java b/src/com/fsck/k9/controller/MessagingController.java index 7578591ab..7da30973c 100644 --- a/src/com/fsck/k9/controller/MessagingController.java +++ b/src/com/fsck/k9/controller/MessagingController.java @@ -3590,7 +3590,9 @@ public class MessagingController implements Runnable { List messagesToDelete = new ArrayList(); for (Message message : messages) { long rootId = ((LocalMessage) message).getRootId(); - Message[] messagesInThread = localStore.getMessagesInThread(rootId); + long threadId = (rootId == -1) ? message.getId() : rootId; + + Message[] messagesInThread = localStore.getMessagesInThread(threadId); Collections.addAll(messagesToDelete, messagesInThread); }