1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-13 08:02:38 +03:00

Null guard widget listener

This commit is contained in:
Richard Lewis
2018-03-13 11:58:47 +00:00
parent 7d13edc67a
commit 8b311c706c

View File

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