aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2013-03-26 22:35:41 -0700
committerGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2013-03-26 22:35:41 -0700
commit35cf435e289ae5de353a7b67b28a5d982c124d5d (patch)
tree6cc19507928fd2f4fb5e05506d8f56c274053dc5 /src
parent26495360bb02102ab1a99734223ba634a2c7efaf (diff)
Check if progress block is nil before calling it.
Diffstat (limited to 'src')
-rw-r--r--src/objc/imap/MCOIMAPAppendMessageOperation.mm4
-rw-r--r--src/objc/imap/MCOIMAPFetchContentOperation.mm4
-rw-r--r--src/objc/imap/MCOIMAPFetchMessagesOperation.mm4
3 files changed, 9 insertions, 3 deletions
diff --git a/src/objc/imap/MCOIMAPAppendMessageOperation.mm b/src/objc/imap/MCOIMAPAppendMessageOperation.mm
index c8f60d0a..dc3409f7 100644
--- a/src/objc/imap/MCOIMAPAppendMessageOperation.mm
+++ b/src/objc/imap/MCOIMAPAppendMessageOperation.mm
@@ -58,7 +58,9 @@ typedef void (^completionType)(NSError *error, uint32_t createdUID);
- (void) bodyProgress:(unsigned int)current maximum:(unsigned int)maximum
{
- _progress(current, maximum);
+ if (_progress != NULL) {
+ _progress(current, maximum);
+ }
}
@end
diff --git a/src/objc/imap/MCOIMAPFetchContentOperation.mm b/src/objc/imap/MCOIMAPFetchContentOperation.mm
index 49bdee1d..d4e4192b 100644
--- a/src/objc/imap/MCOIMAPFetchContentOperation.mm
+++ b/src/objc/imap/MCOIMAPFetchContentOperation.mm
@@ -58,7 +58,9 @@ typedef void (^completionType)(NSError *error, NSData * data);
- (void) bodyProgress:(unsigned int)current maximum:(unsigned int)maximum
{
- _progress(current, maximum);
+ if (_progress != NULL) {
+ _progress(current, maximum);
+ }
}
@end
diff --git a/src/objc/imap/MCOIMAPFetchMessagesOperation.mm b/src/objc/imap/MCOIMAPFetchMessagesOperation.mm
index 3cc8b164..c6a3699d 100644
--- a/src/objc/imap/MCOIMAPFetchMessagesOperation.mm
+++ b/src/objc/imap/MCOIMAPFetchMessagesOperation.mm
@@ -54,7 +54,9 @@ typedef void (^completionType)(NSError *error, NSArray * messages, MCOIndexSet *
- (void) itemProgress:(unsigned int)current maximum:(unsigned int)maximum
{
- _progress(current);
+ if (_progress != NULL) {
+ _progress(current);
+ }
}
@end