This repository was archived by the owner on Jul 19, 2019. It is now read-only.
Fix issue when componentWillUnmount()#175
Open
mloisotto wants to merge 1 commit intoreactjs:masterfrom
Open
Conversation
When componentWillUnmount, it tries to get chart object from this.state and execute destroy() function. This is not validating when chart is undefined or null. This PR, only verifies that condition.
austinpray
suggested changes
Apr 6, 2017
| classData.componentWillUnmount = function() { | ||
| var chart = this.state.chart; | ||
| chart.destroy(); | ||
| if(chart) |
Member
There was a problem hiding this comment.
sorry for the nitpick, but could you wrap this if statement with braces?
There was a problem hiding this comment.
@mloisotto Do you have an estimation on when you can get to this? I am currently being blocked by it. If you can't let me know and I can take over.
Collaborator
|
@mloisotto this PR can be closed. The code is already in master: https://github.com/reactjs/react-chartjs/blob/master/lib/core.js#L33 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
When componentWillUnmount, it tries to get chart object from this.state and execute destroy() function. This is not validating when chart is undefined or null.
This PR, only verifies that condition.