Skip to content

Commit

Permalink
Adds a conditional check around ellipsis removal in ComponentWillUnmo…
Browse files Browse the repository at this point in the history
…unt to help pass test suites and other situations where it might be missing
  • Loading branch information
kevinparkerson authored and pablosichert committed Apr 14, 2020
1 parent 6f251fa commit cce8d0e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Truncate.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ export default class Truncate extends Component {
timeout
} = this;

ellipsis.parentNode.removeChild(ellipsis);
if (ellipsis && ellipsis.parentNode) {
ellipsis.parentNode.removeChild(ellipsis);
}

window.removeEventListener('resize', onResize);

Expand Down

0 comments on commit cce8d0e

Please sign in to comment.