From d7c1927bb1a6c9062d0472dc77d0adeef2a87228 Mon Sep 17 00:00:00 2001 From: Pradeeppon01 Date: Thu, 4 Jul 2024 13:50:40 +0530 Subject: [PATCH] latest --- src/Components/AnomolyPartC.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Components/AnomolyPartC.jsx b/src/Components/AnomolyPartC.jsx index 60f9900..8eb77ae 100644 --- a/src/Components/AnomolyPartC.jsx +++ b/src/Components/AnomolyPartC.jsx @@ -94,7 +94,7 @@ function AnomalyPartC() { if (!reduxSystemNo) { setShowSystemNoContainer(true); } else { - if (evErrorsList.length > 0) { + if (evErrorsList && evErrorsList.length > 0) { setAnomalyData(evErrorsList); } else { fetchAnomalyData(); @@ -106,7 +106,7 @@ function AnomalyPartC() { if (!reduxSystemNo) { setShowSystemNoContainer(true); } else { - if (evErrorsData.length > 0) { + if (evErrorsData && evErrorsData.length > 0) { setEvErrors(evErrorsData); } if (error && errorReason) { @@ -222,6 +222,7 @@ function AnomalyPartC() { function getRecordsBySystemId(records, systemId) { const new_data = []; + if(!records) records = [] for (var i = 0; i < records.length; i++) { var count = i % 5; if (count === systemId - 1) {