Make sure that capabilities array is initialised.

This commit is contained in:
Richard Lewis 2017-12-19 17:15:06 +00:00
parent 536d4efc40
commit 08bcfc5c4e

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);