Skip to content

Commit

Permalink
Don't try to remove cruft if null (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
tht13 authored and benjeffery committed Jun 17, 2016
1 parent 3a2b73c commit 9ce84d6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/PlotlyComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ var PlotlyComponent = React.createClass({
componentWillUnmount: function() {
//Remove some cruft left behind by plotly
var cruft = document.getElementById("js-plotly-tester");
cruft.parentNode.removeChild(cruft);
if (cruft !== null) {
cruft.parentNode.removeChild(cruft);
}

this.container.removeAllListeners('plotly_click');
this.container.removeAllListeners('plotly_beforehover');
Expand Down

0 comments on commit 9ce84d6

Please sign in to comment.