Make sure that capabilities array is initialised.

pull/21833/head
Richard Lewis 2017-12-19 17:15:06 +00:00
parent 536d4efc40
commit 08bcfc5c4e
1 changed files with 1 additions and 0 deletions

View File

@ -339,6 +339,7 @@ export default React.createClass({
this.widgetMessaging.addEndpoint(this.props.id, this.props.url);
this.widgetMessaging.getCapabilities().then((capabilities) => {
console.log("Got widget capabilities", this.widgetId, capabilities);
capabilities = capabilities || [];
this.setState({capabilities});
}).catch((err) => {
console.log("Failed to get widget capabilities", this.widgetId, err);