Merge pull request #2057 from matrix-org/t3chguy/null-guard-stickerpicker

add null-guard for stickerpickerWidget in StickerPicker
This commit is contained in:
Matthew Hodgson 2018-07-13 14:47:45 +01:00 committed by GitHub
commit ac1f130f1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -166,6 +166,7 @@ export default class Stickerpicker extends React.Component {
}
_sendVisibilityToWidget(visible) {
if (!this.state.stickerpickerWidget) return;
const widgetMessaging = ActiveWidgetStore.getWidgetMessaging(this.state.stickerpickerWidget.id);
if (widgetMessaging && visible !== this._prevSentVisibility) {
widgetMessaging.sendVisibility(visible);