Skip to content

Commit

Permalink
Check connect error condition in uidValidity and uidNext, should help…
Browse files Browse the repository at this point in the history
… avoid crashes (i hope)
  • Loading branch information
mronge committed Sep 19, 2012
1 parent 4012917 commit d05b8bb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Source/CTCoreFolder.m
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,10 @@ - (struct mailfolder *)folderStruct {
}

- (NSUInteger)uidValidity {
[self connect];
BOOL success = [self connect];
if (!success) {
return 0;
}
mailimap *imapSession;
imapSession = [self imapSession];
if (imapSession->imap_selection_info != NULL) {
Expand All @@ -234,7 +237,10 @@ - (NSUInteger)uidValidity {
}

- (NSUInteger)uidNext {
[self connect];
BOOL success = [self connect];
if (!success) {
return 0;
}
mailimap *imapSession;
imapSession = [self imapSession];
if (imapSession->imap_selection_info != NULL) {
Expand Down

0 comments on commit d05b8bb

Please sign in to comment.