From ab858f3f778ad27999b743b1ba4e438a394eb12e Mon Sep 17 00:00:00 2001 From: Adam Saghy Date: Thu, 26 May 2022 18:17:36 +0200 Subject: [PATCH] Unable to create new loan product or share product #1406 --- ...t-product-interest-rate-chart-step.component.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-interest-rate-chart-step/fixed-deposit-product-interest-rate-chart-step.component.ts b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-interest-rate-chart-step/fixed-deposit-product-interest-rate-chart-step.component.ts index dd7db47c3..f7aa545a0 100644 --- a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-interest-rate-chart-step/fixed-deposit-product-interest-rate-chart-step.component.ts +++ b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-interest-rate-chart-step/fixed-deposit-product-interest-rate-chart-step.component.ts @@ -88,10 +88,12 @@ export class FixedDepositProductInterestRateChartStepComponent implements OnInit assignFormData() { this.addChart(); const isChartArray = Array.isArray(this.fixedDepositProductsTemplate.activeChart); - if (!isChartArray) { - this.chartDetailData.push(this.fixedDepositProductsTemplate.activeChart); - } else { - this.chartDetailData = this.fixedDepositProductsTemplate.activeChart; + if (this.fixedDepositProductsTemplate.activeChart) { + if (!isChartArray) { + this.chartDetailData.push(this.fixedDepositProductsTemplate.activeChart); + } else { + this.chartDetailData = this.fixedDepositProductsTemplate.activeChart; + } } // Build the array of Objects from the retrived value @@ -100,6 +102,10 @@ export class FixedDepositProductInterestRateChartStepComponent implements OnInit // Iterates for every chart in charts this.charts.controls.forEach((chartDetailControl: FormGroup, i: number) => { + if (!this.chartsDetail[i]) { + return; + } + // Iterate for every chartSlab in chart this.chartsDetail[i].chartSlabs.forEach((chartSlabDetail: any, j: number) => {