}, function(error, response, body) {
if (utils.validateResponse('VNFR.get', error, response, body, resolve, reject)) {
var data = JSON.parse(response.body);
- var returnData = id ? [data["vnfr:vnfr"]] : data.collection["vnfr:vnfr"];
+ var returnData = id ? (data["vnfr:vnfr"] ? [data["vnfr:vnfr"]] : []) : data.collection["vnfr:vnfr"];
returnData.forEach(function(vnfr) {
- vnfr['nfvi-metrics'] = buildNfviGraphs(vnfr.vdur);
- vnfr['epa-params'] = epa_aggregator(vnfr.vdur);
+ vnfr['nfvi-metrics'] = vnfr.vdur ? buildNfviGraphs(vnfr.vdur) : [];
+ vnfr['epa-params'] = vnfr.vdur ? epa_aggregator(vnfr.vdur) : [];
vnfr['service-primitives-present'] = (vnfr['vnf-configuration'] && vnfr['vnf-configuration']['service-primitive'] && vnfr['vnf-configuration']['service-primitive'].length > 0) ? true : false;
vnfr['vdur'] && vnfr['vdur'].map(function(vdur, vdurIndex) {
// This console-url is what front-end will hit to generate a real console-url
<img src={circleXImage} title="Close card" />
</a>
);
- if (this.props.hasAccess) closebutton = null;
+ if (this.props.hasAccess) {
+ closeButton = null;
+ }
html = (
<DashboardCard className={'launchpadCard'} closeCard={closeButton}>
<LaunchpadHeader nsr={this.props.nsr} name={this.props.name} isActive={this.props.isActive} id={this.props.id}/>
(<li key="nsr"><h3>NSR: {this.props.nsr['cloud-account']}</h3></li>)
)
}
- this.props.nsr['vnfrs'].map(function(v,i) {
+ this.props.nsr && this.props.nsr['vnfrs'] && this.props.nsr['vnfrs'].map(function(v,i) {
if(v.hasOwnProperty('cloud-account')) {
status.push(
(<li key={i}><h3>VNFR {v['short-name']}: {v['cloud-account']}</h3></li>)