-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fix prevent js crashes from null value in messages #7
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pull request does not contain a valid label. Please add one of the following labels: ['type: feature', 'type: change', 'type: fix', 'type: removal', 'target: developer-experience', 'type: internal']
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @rsdeus, here my suggestions to pass the npm run lint
linter.
@@ -25,9 +25,11 @@ export const getMessages = (key = null) => { | |||
* @returns {Object} The converted dictionary object | |||
*/ | |||
export const createDictionary = (messages, prefix = "") => { | |||
if (!messages) return {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!messages) return {}; |
@@ -25,9 +25,11 @@ export const getMessages = (key = null) => { | |||
* @returns {Object} The converted dictionary object | |||
*/ | |||
export const createDictionary = (messages, prefix = "") => { | |||
if (!messages) return {}; | |||
|
|||
let final = {}; | |||
Object.keys(messages).forEach((key) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Object.keys(messages).forEach((key) => { | |
Object.keys(messages || {}).forEach((key) => { |
🎩 What? Why?
When there is a null value in var
messages
, thei18n.js
script crashes, the WYSIWYG editor doesn't show up, and the textarea becomes disabled.📌 Related Issues
Link your PR to an issue
Testing
📷 Screenshots