fix: reading 'map' but found null error

This commit is contained in:
18alantom
2021-12-17 12:18:09 +05:30
committed by Alan
parent f502b8004b
commit e9192fa6ef
+1
View File
@@ -70,6 +70,7 @@ export default class PaymentServer extends BaseDocument {
}
validateReferenceAmount() {
if (!this.for?.length) return;
const referenceAmountTotal = this.for
.map(({ amount }) => amount)
.reduce((a, b) => a + b, 0);