From 759e74a88d26c5212fd354e0c8f9d7be3c6d47a3 Mon Sep 17 00:00:00 2001 From: Dan Zajdband Date: Tue, 3 Jan 2017 10:46:55 -0300 Subject: [PATCH] coral-admin: Fixed check for component unmount removing a listener when there is no object --- client/coral-admin/src/components/CommentList.js | 4 +--- client/coral-ui/components/Dialog.js | 4 +++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/coral-admin/src/components/CommentList.js b/client/coral-admin/src/components/CommentList.js index 326d63cf1..a1a990490 100644 --- a/client/coral-admin/src/components/CommentList.js +++ b/client/coral-admin/src/components/CommentList.js @@ -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) } diff --git a/client/coral-ui/components/Dialog.js b/client/coral-ui/components/Dialog.js index 9af9be6dd..17cb78d28 100644 --- a/client/coral-ui/components/Dialog.js +++ b/client/coral-ui/components/Dialog.js @@ -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() {