-
Notifications
You must be signed in to change notification settings - Fork 4k
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
[Bug] referenceButtons creates errors when undefined #183
Comments
8 tasks
Hello @AmasiaNalbandian, Thank you for using our products and for your solution to this issue. We are preparing an upgrade for this product this week, so if you want to contribute, please create a PR or we will integrate your solution in this next update. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
BS5
Reproduction link
Seneca-CDOT/telescope#2691
Operating System
Windows/OS
Device
PC
Browser & Version
Chrome Version 97.0.4692.99
Steps to reproduce
ReferenceButtons is not always defined, See
material-dashboard/assets/js/material-dashboard.js
Line 626 in 6671668
We should protect this.
What is expected?
There should not be any errors in console due to undefined variables.
What is actually happening?
Error in console:
Uncaught TypeError: Cannot read properties of null (reading 'classList') at 'navbarColorOnResize.
Solution
use optional chaining as below:
if (referenceButtons?.classList.contains('active') && referenceButtons?.getAttribute('data-class') === 'bg-transparent') {
Additional comments
I'd be happy to contribute the fix for this.
The text was updated successfully, but these errors were encountered: