-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
Both NetWorthChart
and CashOutflowChart
components assume that results.yearlyResults
is always a non-empty array. If projectionYears
is set to 0 or a negative value (e.g., via URL or direct state manipulation), or if calculation logic fails, yearlyResults
can be empty. This causes runtime errors (e.g., .map
on undefined or empty arrays) and chart rendering failures.
Steps to Reproduce
- Set
projectionYears
to 0 or a negative value (e.g., via URL or programmatically). - Observe that the charts fail to render and may throw runtime errors.
Expected Behavior
Charts should gracefully handle empty or undefined data, displaying a user-friendly message instead of crashing.
Suggested Fix
Add runtime guards in both chart components to check for empty or undefined yearlyResults
and render a fallback UI when no data is available.
Metadata
Metadata
Assignees
Labels
No labels