Use hasOwnProperty instead of length for checking if property exist

This commit is contained in:
dinamiko 2022-04-05 14:29:33 +02:00
parent 0154707c72
commit b7a9ccec4e

View file

@ -218,7 +218,8 @@ class CreditCardRenderer {
}).catch(err => {
this.spinner.unblock();
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);
}
});