Почему discountOriginalTotal возвращает значение NULL?
Я получаю сообщение об ошибке: Uncaught (в обещании) TypeError: Невозможно прочитать свойство '1' с нулевым значением
в чем проблема?
изображение консоли
function(t) {
var e = {
valid: !1,
code: "",
total_price: !1,
original_total_price: !1,
total_discount: !1,
warning: !1,
exactMatch: !1,
items: []
};
if (this.discountValid.test(t)) {
e.valid = !0,
e.code = t.match(this.discountCode)[1].trim(),
**e.original_total_price = parseInt(t.match(this.discountOriginalTotal)[1].replace(".", "")),**
e.total_price = parseInt(t.match(this.discountTotal)[1]),
e.total_discount = e.original_total_price - e.total_price;
for (var n = void 0; n = this.products.exec(t); ) {
var a = {
id: parseInt(n[1]),
line_price: parseInt(n[3].replace(".", "")),
original_line_price: parseInt(n[3].replace(".", ""))
};
void 0 !== n[2] && (a.original_line_price = parseInt(n[2].replace(".", ""))),
a.total_discount = a.original_line_price - a.line_price,
e.items.push(a)
}
return e
}
return this.discountWarning.test(t) ? (e.original_total_price = e.total_price = parseInt(t.match(this.discountTotal)[1]),
e.code = t.match(this.discountWarning)[2],
e.warning = t.match(this.discountWarning)[1],
e) : e
}
Спасибо