reactjs / react-chartjs

common react charting components using chart.js
MIT License
2.93k stars 301 forks source link

Fix issue when componentWillUnmount() #175

Open mloisotto opened 7 years ago

mloisotto commented 7 years ago

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.

benmccann commented 6 years ago

@mloisotto this PR can be closed. The code is already in master: https://github.com/reactjs/react-chartjs/blob/master/lib/core.js#L33