Skip to content

Commit

Permalink
Fix the issue with some games not having platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
KavetiRohith committed Sep 14, 2023
1 parent ffb0d5a commit beb81b1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/GameCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const GameCard = ({ game }: GameCardProps) => {
<CardBody>
<HStack justifyContent="space-between" marginBottom={3}>
<PlatformIconList
platforms={game.parent_platforms.map((p) => p.platform)}
platforms={game.parent_platforms?.map((p) => p.platform)}
/>
<CriticScore score={game.metacritic} />
</HStack>
Expand Down
2 changes: 1 addition & 1 deletion src/components/PlatformIconList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface PlatformIconListProps {
platforms: Platform[];
}

const PlatformIconList = ({ platforms }: PlatformIconListProps) => {
const PlatformIconList = ({ platforms = [] }: PlatformIconListProps) => {
const IconMap: { [key: string]: IconType } = {
pc: FaWindows,
playstation: FaPlaystation,
Expand Down

0 comments on commit beb81b1

Please sign in to comment.