From 4a287fd112d949c51a408a770eb30a1018d8ef42 Mon Sep 17 00:00:00 2001 From: Palash gupta Date: Sun, 22 May 2022 20:59:35 +0530 Subject: [PATCH] fix: handle the broken state --- frontend/src/modules/Servicemap/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/modules/Servicemap/utils.ts b/frontend/src/modules/Servicemap/utils.ts index de94109d61..21b93952a8 100644 --- a/frontend/src/modules/Servicemap/utils.ts +++ b/frontend/src/modules/Servicemap/utils.ts @@ -20,8 +20,8 @@ export const getDimensions = (num, highest) => { export const getGraphData = (serviceMap): graphDataType => { const { items, services } = serviceMap; - const highestCallCount = maxBy(items, (e) => e.callCount).callCount; - const highestCallRate = maxBy(services, (e) => e.callRate).callRate; + const highestCallCount = maxBy(items, (e) => e?.callCount)?.callCount; + const highestCallRate = maxBy(services, (e) => e?.callRate)?.callRate; const divNum = Number( String(1).padEnd(highestCallCount.toString().length, '0'), );