Skip to content

fix(connection-detail): guard chartData access with optional chaining#4097

Open
guitavano wants to merge 1 commit into
mainfrom
fix/connection-activity-chart-crash
Open

fix(connection-detail): guard chartData access with optional chaining#4097
guitavano wants to merge 1 commit into
mainfrom
fix/connection-activity-chart-crash

Conversation

@guitavano

@guitavano guitavano commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix TypeError: Cannot read properties of undefined (reading '0') crash on the connection detail page
  • Add optional chaining (?.) before array index access on chartData for the chart axis labels

Test plan

  • Open a connection detail page with no monitoring data and verify no crash
  • Open a connection detail page with monitoring data and verify axis labels render correctly

🤖 Generated with Claude Code


Summary by cubic

Prevent crash on the connection detail page when chartData is undefined by guarding index access with optional chaining for the axis labels. This avoids the runtime TypeError and keeps the page rendering even without monitoring data.

Written for commit 22c2313. Summary will update on new commits.

Review in cubic

chartData could be undefined at runtime causing TypeError when accessing
chartData[0] and chartData[chartData.length - 1] for axis labels.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant