CI app relationships don't render when application is deleted
@@ -15,8 +15,11 @@ export function groupRelationships(ciId, rels = []) {
export function enrichRelationships(rels = [], entities = []) {
const entitiesById = _.keyBy(entities, 'id');
- return _.map(rels, rel => Object.assign({}, {
+ return _.chain(rels)
+ .map(rel => Object.assign({}, {
relationship: rel.relationship,
entity: entitiesById[rel.entity.id]
- }));
+ }))
+ .filter(rel => rel.entity)
+ .value();
}
\ No newline at end of file
