Skip to content

fix : added null guard for activity_date in ActivityDashboard - #10

Open
tmdeveloper007 wants to merge 1 commit into
syedahmedkhaderi:mainfrom
tmdeveloper007:activity-null-guard
Open

fix : added null guard for activity_date in ActivityDashboard#10
tmdeveloper007 wants to merge 1 commit into
syedahmedkhaderi:mainfrom
tmdeveloper007:activity-null-guard

Conversation

@tmdeveloper007

Copy link
Copy Markdown

Summary of What Has Been Done:
Added null and validity checks for activity_date before parsing it as a Date. If activity_date is null, undefined, or results in an invalid Date (NaN getTime()), it is filtered out before being added to the activityDates array. This prevents malformed date entries from corrupting the streak counter and heatmap rendering.

Changes Made:

  • app/components/dashboard/ActivityDashboard.jsx: Added null guard in the data mapping function. Added isNaN check. Added .filter(Boolean) to remove invalid entries.

Impact it Made:

  • Prevents invalid date strings from breaking the streak counter and heatmap display
  • Makes the dashboard more resilient to data inconsistencies
  • Verified with ESLint: no new errors introduced

Note: Please assign this PR to the tmdeveloper007 account.

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