Skip to content

Commit

Permalink
Handle potential undefined value on CardRows (#834)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffvli committed Nov 19, 2024
1 parent b65c972 commit 6a61924
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/renderer/components/card/album-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export const AlbumCard = ({
<ImageSection />
</Skeleton>
<DetailSection style={{ width: '100%' }}>
{cardRows.map((_row: CardRow<Album>, index: number) => (
{(cardRows || []).map((_row: CardRow<Album>, index: number) => (
<Skeleton
visible
height={15}
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/card/poster-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export const PosterCard = ({
</Skeleton>
<DetailContainer>
<Stack spacing="sm">
{controls.cardRows.map((row, index) => (
{(controls?.cardRows || []).map((row, index) => (
<Skeleton
key={`${index}-${row.arrayProperty}`}
visible
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export const DefaultCard = ({
</ImageContainer>
<DetailContainer>
<Stack spacing="sm">
{controls.cardRows.map((row, index) => (
{(controls?.cardRows || []).map((row, index) => (
<Skeleton
key={`${index}-${columnIndex}-${row.arrayProperty}`}
visible
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export const PosterCard = ({
</Skeleton>
<DetailContainer>
<Stack spacing="sm">
{controls.cardRows.map((row, index) => (
{(controls?.cardRows || []).map((row, index) => (
<Skeleton
key={`${index}-${columnIndex}-${row.arrayProperty}`}
visible
Expand Down

0 comments on commit 6a61924

Please sign in to comment.