Skip to content

Guard chart components against null streaming data#487

Open
CodexNexor wants to merge 1 commit intothesysdev:mainfrom
CodexNexor:fix/chart-null-guard
Open

Guard chart components against null streaming data#487
CodexNexor wants to merge 1 commit intothesysdev:mainfrom
CodexNexor:fix/chart-null-guard

Conversation

@CodexNexor
Copy link
Copy Markdown

Summary

  • add a shared ensureChartData() helper that normalizes null/undefined chart data to []
  • apply the runtime guard across the GenUI-facing chart components that can receive partial streaming props before the full payload arrives
  • keep export/legend/domain calculations aligned with the guarded data so Recharts never receives a null dataset during streaming

Why this fix

The chart schemas in current main already require the expected fields, but that still doesn't fully protect the runtime streaming path when partial data reaches the components before the payload is complete. This PR adds the missing runtime safety layer without changing the public API.

Validation

  • ran git diff --check
  • manually verified the guarded components now derive their Recharts data prop from ensureChartData(...)

Closes #355.

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.

Charts component crashes with TypeError during streaming: null data passed to Recharts

1 participant