From 2f091434de20cb4418fcd7ddb9cbe7c7977d224b Mon Sep 17 00:00:00 2001 From: chaem03 Date: Thu, 14 Nov 2024 11:10:52 +0900 Subject: [PATCH] =?UTF-8?q?[Fix]-=20=EB=88=84=EA=B5=AC=20=EC=86=8C?= =?UTF-8?q?=EA=B0=9C=20introList=20=EC=98=88=EC=99=B8=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/rankingBox/RankingBox.jsx | 4 +++- src/pages/nuguIntro/NuguIntro.jsx | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/rankingBox/RankingBox.jsx b/src/components/rankingBox/RankingBox.jsx index 2488d26..b10bcfd 100644 --- a/src/components/rankingBox/RankingBox.jsx +++ b/src/components/rankingBox/RankingBox.jsx @@ -3,7 +3,9 @@ import * as S from "./styled"; export const RankingBox = ({ NuguIntroRank }) => { const rank = [2, 1, 3]; const isNuguIntroRank = - Object.keys(NuguIntroRank).length > 0 ? NuguIntroRank : null; + NuguIntroRank && Object.keys(NuguIntroRank).length > 0 + ? NuguIntroRank + : null; return ( {rank.map((item) => { diff --git a/src/pages/nuguIntro/NuguIntro.jsx b/src/pages/nuguIntro/NuguIntro.jsx index 64fd273..484ced2 100644 --- a/src/pages/nuguIntro/NuguIntro.jsx +++ b/src/pages/nuguIntro/NuguIntro.jsx @@ -29,7 +29,8 @@ export const NuguIntro = () => { fetchData(); }, [uuid]); - const isNuguIntro = Object.keys(introList).length > 0 ? introList : null; + const isNuguIntro = + introList && Object.keys(introList).length > 0 ? introList : null; console.log("isNuguIntro", isNuguIntro); const moveOnintro = () => { navigate(`/nuguIntro/write/${uuid}`);