Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
fix(app): Fix random infinite loops
Browse files Browse the repository at this point in the history
  • Loading branch information
mjschranz committed May 22, 2015
1 parent a119aa3 commit bbba42f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
8 changes: 6 additions & 2 deletions app/scripts/components/tables/tableicious.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,9 @@ module ngApp.components.tables.directives.tableicious {

$scope.$watch(()=>{
return $scope.config.headings.map(function(head){
return head.displayName;
if (head) {
return head.displayName;
}
})
},()=>{
$scope.order = this.createOrderArray($scope.config.headings);
Expand All @@ -206,7 +208,9 @@ module ngApp.components.tables.directives.tableicious {

$scope.$watch(()=>{
return $scope.config.headings.map(function(head:TableiciousColumnDefinition){
return head.hidden;
if (head) {
return head.hidden;
}
})
},()=>{
refresh();
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/components/tables/tables.controllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ module ngApp.components.tables.controllers {
/* @ngInject */
constructor(private $scope: IGDCTableScope) {
this.sortingHeadings = _.filter($scope.config.headings, (heading: any) => {
return heading.sortable;
return heading && heading.sortable;
});

if ($scope.clientSide) {
Expand Down
6 changes: 4 additions & 2 deletions app/scripts/components/tables/tables.services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ module ngApp.components.tables.services {
}
return headings.reduce(function(a,b){
function addChildrenOfNode(node){
a.push(node)
a.push(node);
if (node.parent) {
node.nestingLevel = node.parent.nestingLevel + 1;
} else {
Expand All @@ -104,7 +104,9 @@ module ngApp.components.tables.services {
});
}
}
addChildrenOfNode(b);
if (b) {
addChildrenOfNode(b);
}
return a;
},[]).map(function(heading){
heading.parent = undefined;
Expand Down
5 changes: 5 additions & 0 deletions app/scripts/search/search.files.table.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@ module ngApp.search.models {
var annotations = _.find(row, (item) => {
return item.id === "annotations";
});

if (!annotations) {
return;
}

var annotationIds = _.map(annotations.val, (annotation: any) => {
return annotation.annotation_id;
});
Expand Down
5 changes: 5 additions & 0 deletions app/scripts/search/search.participants.table.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,11 @@ module ngApp.search.models {
var annotations = _.find(row, (item) => {
return item.id === "annotations";
});

if (!annotations) {
return;
}

var annotationIds = _.map(annotations.val, (annotation: any) => {
return annotation.annotation_id;
});
Expand Down

0 comments on commit bbba42f

Please sign in to comment.