Skip to content

fix: Add conditional accessing + regression issue#1682

Merged
subodhr258 merged 2 commits intomainfrom
hotfix/dashboard-console-error
Feb 26, 2026
Merged

fix: Add conditional accessing + regression issue#1682
subodhr258 merged 2 commits intomainfrom
hotfix/dashboard-console-error

Conversation

@subodhr258
Copy link
Copy Markdown
Collaborator

@subodhr258 subodhr258 commented Feb 26, 2026

Issue - https://github.com/rtCamp/godam-core/issues/779

This pull request makes a small change to how the plays value is handled in the dashboard chart component, ensuring that null or undefined values are safely formatted and displayed as zero.

  • Defensive coding: Updated the logic in main() within ChartsDashboard.js to use plays ?? 0 when formatting and setting the title, preventing issues when plays is null or undefined.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the dashboard charts component to defensively handle missing plays values when rendering the plays metric, avoiding runtime errors when plays is null/undefined.

Changes:

  • Apply a plays ?? 0 fallback when formatting the plays metric for display.
  • Apply a plays ?? 0 fallback when computing the title tooltip value via toLocaleString().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@subodhr258 subodhr258 changed the title fix: Add optional chaining fix: Add optional chaining + regression issue Feb 26, 2026
@subodhr258 subodhr258 changed the title fix: Add optional chaining + regression issue fix: Add conditional accessing + regression issue Feb 26, 2026
Copy link
Copy Markdown
Collaborator

@KMchaudhary KMchaudhary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and LGTM

@subodhr258 subodhr258 merged commit 2456c02 into main Feb 26, 2026
5 of 6 checks passed
@subodhr258 subodhr258 deleted the hotfix/dashboard-console-error branch February 26, 2026 13:46
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.

3 participants