Skip to content
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 NPE during reconciliation #6028

Merged
merged 3 commits into from Feb 13, 2016

Conversation

Projects
None yet
3 participants
@sambev
Copy link
Contributor

commented Feb 12, 2016

ReactDOMSelect's _handleChange function tries to set
this._wrapperState.pendingUpdate = true after executing the onChange
function. However, if the select was removed as a result of said
fuction, this._wrapperState would be null. Resulting in an
Uncaught TypeError: Cannot set property 'pendingUpdate' of null.

#6027

Fix for issue/6027.
ReactDOMSelect's _handleChange function tries to set
this._wrapperState.pendingUpdate = true after executing the onChange
function. However, if the select was removed as a result of said
fuction, this._wrapperState would be null. Resulting in an
Uncaught TypeError: Cannot set property 'pendingUpdate' of null.
@@ -236,7 +236,9 @@ function _handleChange(event) {
var props = this._currentElement.props;
var returnValue = LinkedValueUtils.executeOnChange(props, event);

this._wrapperState.pendingUpdate = true;
if (this._rootNodeID && !this._wrapperState.pendingUpdate) {

This comment has been minimized.

Copy link
@jimfb

jimfb Feb 12, 2016

Contributor

This seems reasonable to me. We don't need to check the value of pendingUpdate, we can just blindly set it to true. Can you update the PR to remove that check?

Remove check for _wrapperState.pendingUpdate.
We can just set it to true regardless.
@@ -236,7 +236,9 @@ function _handleChange(event) {
var props = this._currentElement.props;
var returnValue = LinkedValueUtils.executeOnChange(props, event);

this._wrapperState.pendingUpdate = true;
if (this._rootNodeID) {

This comment has been minimized.

Copy link
@sambev

sambev Feb 13, 2016

Author Contributor

@jimfb Removed check for pendingUpdate. Let me know if there is anything else, or I misunderstood. Thanks!

@facebook-github-bot

This comment has been minimized.

Copy link

commented Feb 13, 2016

@sambev updated the pull request.

@jimfb

This comment has been minimized.

Copy link
Contributor

commented Feb 13, 2016

Looks good, thanks!

jimfb added a commit that referenced this pull request Feb 13, 2016

@jimfb jimfb merged commit 2410dc7 into facebook:master Feb 13, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@jimfb jimfb changed the title Fix for issue/6027. Fix NPE during reconciliation Mar 9, 2016

@renovate renovate bot referenced this pull request Feb 2, 2018

Open

Update dependency react to v0.14.9 #29

0 of 1 task complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.