aboutsummaryrefslogtreecommitdiffhomepage
path: root/example
diff options
context:
space:
mode:
authorGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2013-06-21 22:42:09 -0700
committerGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2013-06-21 22:42:09 -0700
commit086ee3402442e1c020121725306d7cf649e34585 (patch)
tree055f547d8ea03d7c750726f900de09fdd88ccdec /example
parenta7039a0587d56e3984e29386e42e2bb51ecd465f (diff)
Fixed #125: fixed crash in case a fetch is already in progress.
Diffstat (limited to 'example')
-rwxr-xr-xexample/ios/iOS UI Test/iOS UI Test/MCTMsgViewController.mm6
-rw-r--r--example/mac/macExample/macExample/MCTMsgViewController.m2
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];