[FIX] payment_stripe: fix traceback when error has no event

Issue

    - Install eCommerce
    - Add Stripe
    - Pay with invalid cart

    Traceback

Cause

    When I improved stripe error, I didn't checked if
    an error could have no event

Solution

    Check if the error has an event

OPW-2186385

closes odoo/odoo#44414

X-original-commit: 772c02743b5e6610a75e65e408c956eb6057a47d
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
This commit is contained in:
Jason Van Malder
2020-01-31 16:28:08 +00:00
parent 6fa4dbf204
commit 1c14419e93
@@ -81,7 +81,9 @@ PaymentForm.include({
}).guardedCatch(function (error) {
// We don't want to open the Error dialog since
// we already have a container displaying the error
error.event.preventDefault();
if (error.event) {
error.event.preventDefault();
}
// if the rpc fails, pretty obvious
self.enableButton(button);
self.displayError(