Skip to content

Commit

Permalink
Fix runtime error in service group watch when service undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
spadgett committed Jun 17, 2016
1 parent 498b2be commit d904e41
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/scripts/directives/overview/serviceGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ angular.module('openshiftConsole')
});

$scope.$watchGroup(['service', 'childServicesByParent'], function() {
if (!$scope.service) {
return;
}
$scope.childServices = _.get($scope, ['childServicesByParent', $scope.service.metadata.name], []);
$scope.groupedServices = [$scope.service].concat($scope.childServices);
});
Expand Down
2 changes: 1 addition & 1 deletion dist/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -7946,7 +7946,7 @@ _.each(a, function(a) {
return b ? void (b = c.getPreferredDisplayRoute(b, a)) :void (b = a);
}), e.displayRoute = b;
}), e.$watchGroup([ "service", "childServicesByParent" ], function() {
e.childServices = _.get(e, [ "childServicesByParent", e.service.metadata.name ], []), e.groupedServices = [ e.service ].concat(e.childServices);
e.service && (e.childServices = _.get(e, [ "childServicesByParent", e.service.metadata.name ], []), e.groupedServices = [ e.service ].concat(e.childServices));
});
}
};
Expand Down

0 comments on commit d904e41

Please sign in to comment.