1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-14 21:45:14 -05:00

Make sure we always have the ID of a folder when fetching the unread/flagged count

This commit is contained in:
cketti 2013-07-16 16:54:26 +02:00 committed by Jesse Vincent
parent 04ad291ba2
commit 01438d62c9

View File

@ -1530,6 +1530,10 @@ public class LocalStore extends Store implements Serializable {
@Override
public int getUnreadMessageCount() throws MessagingException {
if (mFolderId == -1) {
open(OpenMode.READ_WRITE);
}
try {
return database.execute(false, new DbCallback<Integer>() {
@Override
@ -1557,7 +1561,7 @@ public class LocalStore extends Store implements Serializable {
@Override
public int getFlaggedMessageCount() throws MessagingException {
if (!isOpen()) {
if (mFolderId == -1) {
open(OpenMode.READ_WRITE);
}