Skip to content

Commit ad78acf

Browse files
pettinaripclaude
andcommitted
[recovery] fix: guard IssuesList against GitHub issues with null user
GitHub's REST issues API returns `user: null` for issues authored by deleted ("ghost") accounts. IssuesList renders on the public /contributing page and read `issue.user.login` unguarded inside its `.map()` callback, so a single such issue in the cached GFI list crashed the SSR render with "Cannot read properties of undefined (reading 'login')". Filter out issues without a user before rendering. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 1473dc4 commit ad78acf

1 file changed

Lines changed: 34 additions & 32 deletions

File tree

src/components/IssuesList/index.tsx

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -26,40 +26,42 @@ const IssuesList = async ({ className }: IssuesListProps) => {
2626

2727
return (
2828
<Grid className={cn("my-7", className)}>
29-
{issues.map((issue) => (
30-
<Stack
31-
className="gap-4 rounded-md border border-border p-4"
32-
key={issue.title}
33-
>
34-
<Stack className="gap-2">
35-
<HStack className="gap-2">
36-
<Avatar
37-
name={issue.user.login}
38-
src={issue.user.avatar_url}
39-
size="sm"
40-
href={`https://github.com/${issue.user.login}`}
41-
/>
42-
<p className="text-sm">by {issue.user.login}</p>
43-
</HStack>
29+
{issues
30+
.filter((issue) => issue.user)
31+
.map((issue) => (
32+
<Stack
33+
className="gap-4 rounded-md border border-border p-4"
34+
key={issue.title}
35+
>
36+
<Stack className="gap-2">
37+
<HStack className="gap-2">
38+
<Avatar
39+
name={issue.user.login}
40+
src={issue.user.avatar_url}
41+
size="sm"
42+
href={`https://github.com/${issue.user.login}`}
43+
/>
44+
<p className="text-sm">by {issue.user.login}</p>
45+
</HStack>
4446

45-
<InlineLink
46-
href={issue.html_url}
47-
className="no-underline hover:underline"
48-
>
49-
{issue.title}
50-
</InlineLink>
47+
<InlineLink
48+
href={issue.html_url}
49+
className="no-underline hover:underline"
50+
>
51+
{issue.title}
52+
</InlineLink>
53+
</Stack>
54+
<Flex className="flex-wrap gap-1">
55+
{issue.labels.map((label) => {
56+
return (
57+
<Tag key={label.id} variant="outline">
58+
<Emoji text={label.name} />
59+
</Tag>
60+
)
61+
})}
62+
</Flex>
5163
</Stack>
52-
<Flex className="flex-wrap gap-1">
53-
{issue.labels.map((label) => {
54-
return (
55-
<Tag key={label.id} variant="outline">
56-
<Emoji text={label.name} />
57-
</Tag>
58-
)
59-
})}
60-
</Flex>
61-
</Stack>
62-
))}
64+
))}
6365
</Grid>
6466
)
6567
}

0 commit comments

Comments
 (0)