coral-admin: Fixed check for component unmount removing a listener when there is no object

This commit is contained in:
Dan Zajdband
2017-01-03 10:46:55 -03:00
parent b0e4b79a6a
commit 759e74a88d
2 changed files with 4 additions and 4 deletions
@@ -25,9 +25,7 @@ export default class CommentList extends React.Component {
loading: PropTypes.bool,
// list of actions (flags, etc) associated with the comments
actions: PropTypes.shape({
ids: PropTypes.arrayOf(PropTypes.string)
}),
actions: PropTypes.arrayOf(PropTypes.string),
suspectWords: PropTypes.arrayOf(PropTypes.string)
}
+3 -1
View File
@@ -42,7 +42,9 @@ export default class Dialog extends Component {
componentWillUnmount() {
const dialog = this.dialog;
dialog.removeEventListener('cancel', this.props.onCancel);
if (dialog) {
dialog.removeEventListener('cancel', this.props.onCancel);
}
}
render() {