Skip to content

Commit

Permalink
do not open folder to get number of total messages in case it is clos…
Browse files Browse the repository at this point in the history
…ed, return cached value or 0 instead. #2724
  • Loading branch information
j-dimension committed Dec 10, 2024
1 parent 3e044a8 commit 409a84a
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

}
Expand Down

0 comments on commit 409a84a

Please sign in to comment.