From 086ee3402442e1c020121725306d7cf649e34585 Mon Sep 17 00:00:00 2001 From: "Hoa V. DINH" Date: Fri, 21 Jun 2013 22:42:09 -0700 Subject: Fixed #125: fixed crash in case a fetch is already in progress. --- example/ios/iOS UI Test/iOS UI Test/MCTMsgViewController.mm | 6 ++++-- example/mac/macExample/macExample/MCTMsgViewController.m | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'example') 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]; -- cgit v1.2.3