Skip to content

Commit

Permalink
Don't call a nil block in MPWaitTask.
Browse files Browse the repository at this point in the history
  • Loading branch information
schani committed Feb 19, 2012
1 parent 4b222f6 commit b9c7580
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Classes/MPWaitTask.m
Expand Up @@ -125,9 +125,11 @@ - (void) runAsynchronouslyWithCompletionBlock: (void (^)(NSObject<MPTask> *, id)

// FIXME: run the blocks without the lock or add a try/finally
if (result != nil) {
_completionBlock (self, result);
if (_completionBlock != nil)
_completionBlock (self, result);
} else if (error != nil) {
_failureBlock (self, error);
if (_failureBlock != nil)
_failureBlock (self, error);
} else {
completionBlock = [_completionBlock copy];
failureBlock = [_failureBlock copy];
Expand Down

0 comments on commit b9c7580

Please sign in to comment.