Skip to content

fix(chart-controls): fix RadioButtonControl crash on empty options and false values#41170

Draft
madhushreeag wants to merge 1 commit into
apache:masterfrom
madhushreeag:fix-RadioButtonControl-crash-on-empty
Draft

fix(chart-controls): fix RadioButtonControl crash on empty options and false values#41170
madhushreeag wants to merge 1 commit into
apache:masterfrom
madhushreeag:fix-RadioButtonControl-crash-on-empty

Conversation

@madhushreeag

Copy link
Copy Markdown
Contributor

SUMMARY

  • Fixed a runtime crash in RadioButtonControl when rendered with an empty options array — normalizedOptions[0] was undefined, causing "Cannot read properties of undefined (reading 'value')"
    • Fixed a secondary bug where a falsy-but-valid initialValue (e.g. 0 or false) was silently ignored due to use of || instead of ??

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screenshot 2026-06-17 at 12 48 50 PM

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.31%. Comparing base (b06c6b7) to head (1792e39).
⚠️ Report is 13 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #41170   +/-   ##
=======================================
  Coverage   64.31%   64.31%           
=======================================
  Files        2652     2652           
  Lines      144807   144807           
  Branches    33423    33423           
=======================================
  Hits        93132    93132           
  Misses      50007    50007           
  Partials     1668     1668           
Flag Coverage Δ
javascript 68.45% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants