diff --git a/src/components/organisms/skill-subsection.astro b/src/components/organisms/skill-subsection.astro index db2915c..a5d3963 100644 --- a/src/components/organisms/skill-subsection.astro +++ b/src/components/organisms/skill-subsection.astro @@ -15,9 +15,10 @@ const { } = Astro.props; const isLevelledSkillSection = (skillsSectionData: Tag[] | LevelledSkill[]): skillsSectionData is LevelledSkill[] => { - if (!skillsSectionData[0]) return false; + const firstSkill = skillsSectionData[0]; + if (!firstSkill) return false; - return (skillsSectionData[0] as LevelledSkill).level !== undefined; + return 'level' in firstSkill && firstSkill.level !== undefined; }; ---