Skip to content

Commit

Permalink
fix: wrapped removeChild call in clearRuler in conditional to ensur…
Browse files Browse the repository at this point in the history
…e we don't get NotFoundError thrown if ruler DOM element was already removed. (#8)
  • Loading branch information
dmatchley authored May 31, 2017
1 parent 71f3ad0 commit 1cccba0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ class ScaleText extends Component {
}

clearRuler() {
document.body.removeChild(this.ruler);
if (this.ruler) {
document.body.removeChild(this.ruler);
}
this.ruler = null;
}

Expand Down

0 comments on commit 1cccba0

Please sign in to comment.