Skip to content

Commit 71b1fb4

Browse files
iHiDclaude
andauthored
Guard against undefined metric.user in impact map (#8711)
MetricPointUserWithTooltip accesses metric.user.handle and metric.user.avatarUrl, but user is optional on the Metric type. Return an empty fragment when user data is missing. Closes #8656 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 80bb08a commit 71b1fb4

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • app/javascript/components/impact

app/javascript/components/impact/map.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ const MetricPointUserWithTooltip = ({
5959
metric: Metric
6060
text: string
6161
}): JSX.Element => {
62+
if (!metric.user) return <></>
63+
6264
const avatarRef = useRef(null)
6365
const content = (
6466
<div

0 commit comments

Comments
 (0)