Make sure that capabilities array is initialised.
This commit is contained in:
parent
536d4efc40
commit
08bcfc5c4e
1 changed files with 1 additions and 0 deletions
|
@ -339,6 +339,7 @@ export default React.createClass({
|
||||||
this.widgetMessaging.addEndpoint(this.props.id, this.props.url);
|
this.widgetMessaging.addEndpoint(this.props.id, this.props.url);
|
||||||
this.widgetMessaging.getCapabilities().then((capabilities) => {
|
this.widgetMessaging.getCapabilities().then((capabilities) => {
|
||||||
console.log("Got widget capabilities", this.widgetId, capabilities);
|
console.log("Got widget capabilities", this.widgetId, capabilities);
|
||||||
|
capabilities = capabilities || [];
|
||||||
this.setState({capabilities});
|
this.setState({capabilities});
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
console.log("Failed to get widget capabilities", this.widgetId, err);
|
console.log("Failed to get widget capabilities", this.widgetId, err);
|
||||||
|
|
Loading…
Reference in a new issue