Null guard widget listener

pull/21833/head
Richard Lewis 2018-03-13 11:58:47 +00:00
parent 7d13edc67a
commit 8b311c706c
1 changed files with 4 additions and 2 deletions

View File

@ -170,8 +170,10 @@ export default class AppTile extends React.Component {
// Widget postMessage listeners // Widget postMessage listeners
try { try {
this.widgetMessaging.stopListening(); if (this.widgetMessaging) {
this.widgetMessaging.removeEndpoint(this.props.id, this.props.url); this.widgetMessaging.stopListening();
this.widgetMessaging.removeEndpoint(this.props.id, this.props.url);
}
} catch (e) { } catch (e) {
console.error('Failed to stop listening for widgetMessaging events', e.message); console.error('Failed to stop listening for widgetMessaging events', e.message);
} }