Skip to content
This repository has been archived by the owner on Jun 14, 2022. It is now read-only.

Commit

Permalink
Merge pull request #18 from 1x-martin/destroy-instance-check
Browse files Browse the repository at this point in the history
Check if scrollbar exists before calling destroy function
  • Loading branch information
idiotWu authored Oct 26, 2017
2 parents ed9913f + b841ebd commit a7f70a6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/react-smooth-scrollbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ export default class Scrollbar extends React.Component {
}

componentWillUnmount() {
this.scrollbar.destroy();
if (this.scrollbar) {
this.scrollbar.destroy();
}
}

componentWillReceiveProps(nextProps) {
Expand Down

0 comments on commit a7f70a6

Please sign in to comment.