Skip to content

Commit 9ce84d6

Browse files
tht13benjeffery
authored andcommitted
Don't try to remove cruft if null (#5)
1 parent 3a2b73c commit 9ce84d6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/PlotlyComponent.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ var PlotlyComponent = React.createClass({
4545
componentWillUnmount: function() {
4646
//Remove some cruft left behind by plotly
4747
var cruft = document.getElementById("js-plotly-tester");
48-
cruft.parentNode.removeChild(cruft);
48+
if (cruft !== null) {
49+
cruft.parentNode.removeChild(cruft);
50+
}
4951

5052
this.container.removeAllListeners('plotly_click');
5153
this.container.removeAllListeners('plotly_beforehover');

0 commit comments

Comments
 (0)