mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Use hasOwnProperty
instead of length
for checking if property exist
This commit is contained in:
parent
0154707c72
commit
b7a9ccec4e
1 changed files with 2 additions and 1 deletions
|
@ -218,7 +218,8 @@ class CreditCardRenderer {
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.spinner.unblock();
|
this.spinner.unblock();
|
||||||
this.errorHandler.clear();
|
this.errorHandler.clear();
|
||||||
if (err.details.length > 0) {
|
|
||||||
|
if (err.hasOwnProperty('details')) {
|
||||||
this.errorHandler.message(err.details.map(d => `${d.issue} ${d.description}`).join('<br/>'), true);
|
this.errorHandler.message(err.details.map(d => `${d.issue} ${d.description}`).join('<br/>'), true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue