Skip to content

Commit

Permalink
Check for when actionSheetDismissedBlock() is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
Sjoerd Janssen committed Jan 12, 2017
1 parent f286b38 commit 71422d2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions TOActionSheet/TOActionSheet.m
Expand Up @@ -814,7 +814,8 @@ - (void)dismissViewWithCompactAnimation
self.backgroundColor = [UIColor clearColor];
} completion:^(BOOL complete) {
[self removeFromSuperview];
self.actionSheetDismissedBlock();
if (self.actionSheetDismissedBlock)
self.actionSheetDismissedBlock();
}];
}

Expand Down Expand Up @@ -863,7 +864,8 @@ - (void)dismissViewWithRegularAnimation
self.backgroundColor = [UIColor clearColor];
} completion:^(BOOL complete) {
[self removeFromSuperview];
self.actionSheetDismissedBlock();
if (self.actionSheetDismissedBlock)
self.actionSheetDismissedBlock();
}];
}

Expand Down

0 comments on commit 71422d2

Please sign in to comment.