Skip to content

Commit

Permalink
Added check for nil handler before calling
Browse files Browse the repository at this point in the history
  • Loading branch information
foulkesjohn committed Apr 15, 2016
1 parent 07ca463 commit 30a4613
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Source/MockUIAlertController/QCOMockAlertVerifier.m
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ - (UIAlertActionStyle)styleForButtonWithTitle:(NSString *)title
- (void)executeActionForButtonWithTitle:(NSString *)title
{
UIAlertAction *action = [self actionWithTitle:title];
[action qcoMock_handler](action);
void (^handler)(UIAlertAction *action) = [action qcoMock_handler];
if (handler) {
handler(action);
}
}

- (UIAlertAction *)actionWithTitle:(NSString *)title
Expand Down

0 comments on commit 30a4613

Please sign in to comment.