[fix] null pointer on checkout destroyed
@@ -458,11 +458,14 @@ public class CheckoutPresenter extends MvpPresenter<CheckoutView, CheckoutProvid
@Override
public void onSuccess(final CheckoutPreference checkoutPreference) {
mCheckoutPreference = checkoutPreference;
+ if (isViewAttached()) {
startCheckoutForPreference();
}
+ }
@Override
public void onFailure(final MercadoPagoError error) {
+ if (isViewAttached()) {
getView().showError(error);
setFailureRecovery(new FailureRecovery() {
@Override
@@ -471,6 +474,7 @@ public class CheckoutPresenter extends MvpPresenter<CheckoutView, CheckoutProvid
}
});
}
+ }
});
}
