From 409a84a6b214ae6350d4de9b893b4e05066a996a Mon Sep 17 00:00:00 2001 From: j-dimension Date: Tue, 10 Dec 2024 16:41:46 +0100 Subject: [PATCH] do not open folder to get number of total messages in case it is closed, return cached value or 0 instead. #2724 --- .../src/com/jdimension/jlawyer/client/mail/FolderContainer.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/j-lawyer-client/src/com/jdimension/jlawyer/client/mail/FolderContainer.java b/j-lawyer-client/src/com/jdimension/jlawyer/client/mail/FolderContainer.java index 694f0227..95b50b1b 100755 --- a/j-lawyer-client/src/com/jdimension/jlawyer/client/mail/FolderContainer.java +++ b/j-lawyer-client/src/com/jdimension/jlawyer/client/mail/FolderContainer.java @@ -753,8 +753,10 @@ public int getUnreadMessageCount() { this.cachedTotal = this.folder.getMessageCount(); } catch (StoreClosedException stex) { log.warn("Unable to determine number of unread messages - folder is closed"); + return Math.max(this.cachedUnread, 0); } catch (MessagingException ex) { log.error("Unable to determine number of unread messages", ex); + return Math.max(this.cachedUnread, 0); } }