diff options
author | Hoa V. DINH <dinh.viet.hoa@gmail.com> | 2013-06-21 22:42:09 -0700 |
---|---|---|
committer | Hoa V. DINH <dinh.viet.hoa@gmail.com> | 2013-06-21 22:42:09 -0700 |
commit | 086ee3402442e1c020121725306d7cf649e34585 (patch) | |
tree | 055f547d8ea03d7c750726f900de09fdd88ccdec /example | |
parent | a7039a0587d56e3984e29386e42e2bb51ecd465f (diff) |
Fixed #125: fixed crash in case a fetch is already in progress.
Diffstat (limited to 'example')
-rwxr-xr-x | example/ios/iOS UI Test/iOS UI Test/MCTMsgViewController.mm | 6 | ||||
-rw-r--r-- | example/mac/macExample/macExample/MCTMsgViewController.m | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/example/ios/iOS UI Test/iOS UI Test/MCTMsgViewController.mm b/example/ios/iOS UI Test/iOS UI Test/MCTMsgViewController.mm index dd2b36ee..ca3aecfc 100755 --- a/example/ios/iOS UI Test/iOS UI Test/MCTMsgViewController.mm +++ b/example/ios/iOS UI Test/iOS UI Test/MCTMsgViewController.mm @@ -91,7 +91,7 @@ MCLog("%s is missing, fetching", partUniqueID.description.UTF8String); if ([_pending containsObject:partUniqueID]) { - return NULL; + return nil; } MCOIMAPPart * part = (MCOIMAPPart *) [_message partForUniqueID:partUniqueID]; @@ -205,7 +205,9 @@ typedef void (^DownloadCallback)(NSError * error); [op setProgress:^(unsigned int current, unsigned int maximum) { MCLog("progress content: %u/%u", current, maximum); }]; - [_ops addObject:op]; + if (op != nil) { + [_ops addObject:op]; + } if (downloadFinished != NULL) { NSMutableArray * blocks; blocks = [_callbacks objectForKey:partUniqueID]; diff --git a/example/mac/macExample/macExample/MCTMsgViewController.m b/example/mac/macExample/macExample/MCTMsgViewController.m index dcb6f41c..f26b783f 100644 --- a/example/mac/macExample/macExample/MCTMsgViewController.m +++ b/example/mac/macExample/macExample/MCTMsgViewController.m @@ -76,7 +76,7 @@ NSLog(@"%@ is missing, fetching", partUniqueID); if ([_pending containsObject:partUniqueID]) { - return NULL; + return nil; } MCOIMAPPart * part = (MCOIMAPPart *) [_message partForUniqueID:partUniqueID]; |