diff --git a/layers/components/layouts/Footer.vue b/layers/components/layouts/Footer.vue index 62779aa..1fd33b8 100644 --- a/layers/components/layouts/Footer.vue +++ b/layers/components/layouts/Footer.vue @@ -278,14 +278,22 @@ const useGameRating = computed(() => { ///local/template/common/grades_age const getGameRatingImage = computed((): { type: string, image: string } => { - const contentInfo = footerData.value?.game_rating_info?.rating_type - - // 문자열이 아닌 경우 빈 문자열 반환 - if (!contentInfo || typeof contentInfo !== 'string') { + // 안전하게 rating_type 값 확인 + if ( + !footerData.value?.game_rating_info?.rating_type || + typeof footerData.value.game_rating_info.rating_type !== 'string' + ) { return { type: '', image: '' } } + const contentInfo = footerData.value.game_rating_info.rating_type const ratingType = contentInfo.trim() + + // 빈 문자열인 경우 처리 + if (!ratingType) { + return { type: '', image: '' } + } + const ageTypeMap: Record = { '6': 'Type6', '12': 'Type12', @@ -309,6 +317,14 @@ const getGameRatingImage = computed((): { type: string, image: string } => { }) const getContentInfoImage = computed((): string[] => { + // 안전하게 content_info 값 확인 + if ( + !footerData.value?.game_rating_info?.content_info || + typeof footerData.value.game_rating_info.content_info !== 'string' + ) { + return [] + } + const contentInfo = footerData.value.game_rating_info.content_info.split(',') contentInfo.pop()