From 1955ec9ab13922473adc07366c0b37f6623b917a Mon Sep 17 00:00:00 2001 From: sanjay-k1910 Date: Fri, 6 Oct 2023 21:01:59 +0530 Subject: [PATCH] fix: ecosystem issue Signed-off-by: sanjay-k1910 --- src/components/Ecosystem/Dashboard.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/components/Ecosystem/Dashboard.tsx b/src/components/Ecosystem/Dashboard.tsx index 61d2e2ad0..277667cb4 100644 --- a/src/components/Ecosystem/Dashboard.tsx +++ b/src/components/Ecosystem/Dashboard.tsx @@ -40,12 +40,14 @@ const Dashboard = () => { const { data } = response as AxiosResponse if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) { - const ecosystemData = data?.data[0] - setEcosystemDetails({ - logoUrl: ecosystemData.logoUrl, - name: ecosystemData.name, - description: ecosystemData.description - }) + if (data?.data.length > 0) { + const ecosystemData = data?.data[0] + setEcosystemDetails({ + logoUrl: ecosystemData.logoUrl, + name: ecosystemData.name, + description: ecosystemData.description + }) + } } else { setFailure(response as string) }