From c01adf32469ff3d165066a3e82c1a33cf258ae98 Mon Sep 17 00:00:00 2001 From: Daniel Applebaum Date: Sun, 25 Apr 2010 17:52:59 +0000 Subject: [PATCH] If we're doing a folder-involved search and an account has no folders that match the folder criteria, don't search in the account. --- src/com/fsck/k9/MessagingController.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/com/fsck/k9/MessagingController.java b/src/com/fsck/k9/MessagingController.java index 49bb50847..54b249c7d 100644 --- a/src/com/fsck/k9/MessagingController.java +++ b/src/com/fsck/k9/MessagingController.java @@ -722,8 +722,8 @@ public class MessagingController implements Runnable if (K9.DEBUG) { Log.i(K9.LOG_TAG, "searchLocalMessages (" - + "accounts=" + Utility.combine(accountUuids, ',') - + ", folders = " + Utility.combine(folderNames, ',') + + "accountUuids=" + Utility.combine(accountUuids, ',') + + ", folderNames = " + Utility.combine(folderNames, ',') + ", messages.size() = " + (messages != null ? messages.length : null) + ", query = " + query + ", integrate = " + integrate @@ -837,6 +837,10 @@ public class MessagingController implements Runnable tmpFoldersToSearch.add(localFolder); } } + if (tmpFoldersToSearch.size() < 1) + { + continue; + } foldersToSearch = tmpFoldersToSearch; } catch (MessagingException me)