Skip to content

Allow for false and zero field values to be re-initialized correctly#421

Open
juancstlm wants to merge 1 commit intoteslamotors:masterfrom
juancstlm:bugfix/re-initialize-with-false-or-zero
Open

Allow for false and zero field values to be re-initialized correctly#421
juancstlm wants to merge 1 commit intoteslamotors:masterfrom
juancstlm:bugfix/re-initialize-with-false-or-zero

Conversation

@juancstlm
Copy link

Allow for falsy values such as false and 0 to be re-initialized properly without reverting back to the initial value if they are false or 0

// Otherwise use the fields initial value
if (
!this.getValue(name) &&
(this.getValue(name) == null || this.getValue(name) == undefined) &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for the OR clause as undefined already equals null

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed please make that change

@joepuzzo joepuzzo self-requested a review September 30, 2022 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants