Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[material-ui][Switch] Undefined/null values in the theme causes crash #42113

Open
beaktor opened this issue May 3, 2024 · 1 comment
Open
Assignees
Labels
component: switch This is the name of the generic UI component, not the React module! status: waiting for maintainer These issues haven't been looked at yet by a maintainer

Comments

@beaktor
Copy link

beaktor commented May 3, 2024

Steps to reproduce

https://github.com/mui/material-ui/pull/41367/files#r1586868393

I can put some effort in making an environment, but I hope the comment above is enough using code inspection to suffice for "steps to reproduce". Requested by @siriwatknp, suggested fix included in the PR comment above.

Current behavior

Themes with a undefined/null value will crash

Expected behavior

While not happy path, Switch should tolerate themes with a value that is undefined/null.

Context

Our application dynamically switches between themes, and some themes have extra definitions. These defs might appear as null when it's not relevant. This recent change chokes on that change.

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: switch theme undefined null crash

@beaktor beaktor added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label May 3, 2024
@zannager zannager added the component: switch This is the name of the generic UI component, not the React module! label May 6, 2024
@mnajdova mnajdova assigned siriwatknp and unassigned mj12albert May 14, 2024
@mnajdova
Copy link
Member

@siriwatknp a quick reminder to look into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: switch This is the name of the generic UI component, not the React module! status: waiting for maintainer These issues haven't been looked at yet by a maintainer
Projects
None yet
Development

No branches or pull requests

5 participants