Skip to content
Browse files

Check connect error condition in uidValidity and uidNext, should help…

… avoid crashes (i hope)
  • Loading branch information...
1 parent 4012917 commit d05b8bbeb3f6ff4570340e2633b6d20cb550b156 @mronge mronge committed
Showing with 8 additions and 2 deletions.
  1. +8 −2 Source/CTCoreFolder.m
View
10 Source/CTCoreFolder.m
@@ -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) {
@@ -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) {

0 comments on commit d05b8bb

Please sign in to comment.
Something went wrong with that request. Please try again.