fix: 🐛 Fix issue with setting 0 or false values #1766
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The change involves replacing the logical OR operator (
||
) with the nullish coalescing operator (??
) in the_applyUniforms()
method. This modification addresses a specific issue where 0 or false values were not being correctly assigned. By using the nullish coalescing operator, the code ensures that if the value ofthis.uniforms[name]
is either 0 or false, it will be properly assigned as the value forvalue
. This change enhances the accuracy and reliability of the code by handling these specific cases effectively.✅ Closes: #1741
For #1741
Background
The issue with the original code was that it did not handle 0 and false values correctly when assigning them to uniforms. This resulted in unexpected behavior when attempting to set these values. The change to use the nullish coalescing operator ensures that 0 and false values are properly assigned.
Change List
||
) with nullish coalescing operator (??
) in the_applyUniforms()
method to handle 0 and false values correctly when assigning them to uniforms.