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}`);