Skip to content

Commit

Permalink
Prevent calling requestsDismissalOfViewController
Browse files Browse the repository at this point in the history
This fix prevents calling requestsDismissalOfViewController when there
is nothing to dismiss. The same way
`requestsPresentationOfViewController` is not being called.

This is also crashing on runtime on swift as this is passing `nil` to a
function signature that is mark as `non_null`.
  • Loading branch information
Martin Conte Mac Donell committed Nov 25, 2015
1 parent b5f6c84 commit 077ee24
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion BraintreePayPal/BTPayPalDriver.m
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,10 @@ - (void)requestExpressCheckout:(BTPayPalRequest *)request
- (void)setAppSwitchReturnBlock:(void (^)(BTPayPalAccountNonce *tokenizedAccount, NSError *error))completionBlock
forPaymentType:(BTPayPalPaymentType)paymentType {
appSwitchReturnBlock = ^(NSURL *url) {
[self informDelegatePresentingViewControllerNeedsDismissal];
if (self.safariViewController) {
[self informDelegatePresentingViewControllerNeedsDismissal];
}

[self informDelegateWillProcessAppSwitchReturn];

// Before parsing the return URL, check whether the user cancelled by breaking
Expand Down

0 comments on commit 077ee24

Please sign in to comment.