make sure group is initialized to empty object if undefined to fix console error
This commit is contained in:
John Mitchell
2017-01-03 13:31:04 -05:00
parent 9bad0e7396
commit 234f7b409c

View File

@@ -46,6 +46,10 @@
} }
function buildStatusIndicators(group){ function buildStatusIndicators(group){
if (group === undefined) {
group = {};
}
let group_status, hosts_status; let group_status, hosts_status;
group_status = GetSyncStatusMsg({ group_status = GetSyncStatusMsg({
@@ -142,10 +146,14 @@
$scope.$on(`ws-jobs`, function(e, data){ $scope.$on(`ws-jobs`, function(e, data){
var group = Find({ list: $scope.groups, key: 'id', val: data.group_id }); var group = Find({ list: $scope.groups, key: 'id', val: data.group_id });
if (group === undefined) {
group = {};
}
if(data.status === 'failed' || data.status === 'successful'){ if(data.status === 'failed' || data.status === 'successful'){
$state.reload(); $state.reload();
} } else {
else{
var status = GetSyncStatusMsg({ var status = GetSyncStatusMsg({
status: data.status, status: data.status,
has_inventory_sources: group.has_inventory_sources, has_inventory_sources: group.has_inventory_sources,