Fix getting attribute from null element error in javascript
What does this MR do and why?
- In EE Premium and EE Ultimate, when
::License.feature_available?(:password_complexity)istrue, everything will OK. - In EE Starter, when
::License.feature_available?(:password_complexity)isfalse,elwill be null , frontend will throw anUncaught TypeError: Cannot read properties of null (reading 'dataset')error in browser console, but it will not affect page features becausenew PasswordValidator()is the last line in pages using it. This MR is to fix this error.
Screenshots or screen recordings
when ::License.feature_available?(:password_complexity) is false
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Kun Qian
