diff --git a/src/index.jsx b/src/index.jsx index 36b44aa..3d4f428 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -56,8 +56,10 @@ class LinesEllipsis extends React.Component { } componentWillUnmount () { - this.canvas.parentNode.removeChild(this.canvas) - this.canvas = null + if (this.canvas) { + this.canvas.parentNode.removeChild(this.canvas) + this.canvas = null + } } setState (state, callback) {