Skip to content

Commit 8899522

Browse files
committed
Fix undefined-problem in dependency graph
1 parent e02e8bb commit 8899522

1 file changed

Lines changed: 17 additions & 15 deletions

File tree

src/app/component/dependency-graph/dependency-graph.component.ts

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,23 @@ export class DependencyGraphComponent implements OnInit {
6161
try {
6262
var activitysThatCurrenActivityIsDependentOn =
6363
this.YamlObject[activity]['dependsOn'];
64-
for (
65-
var j = 0;
66-
j < activitysThatCurrenActivityIsDependentOn.length;
67-
j++
68-
) {
69-
this.checkIfNodeHasBeenGenerated(
70-
activitysThatCurrenActivityIsDependentOn[j]
71-
);
72-
this.graphData['links'].push({
73-
source: activitysThatCurrenActivityIsDependentOn[j],
74-
target: activity,
75-
});
76-
this.populateGraphWithActivitiesCurrentActivityDependsOn(
77-
activitysThatCurrenActivityIsDependentOn[j]
78-
);
64+
if (activitysThatCurrenActivityIsDependentOn) {
65+
for (
66+
var j = 0;
67+
j < activitysThatCurrenActivityIsDependentOn.length;
68+
j++
69+
) {
70+
this.checkIfNodeHasBeenGenerated(
71+
activitysThatCurrenActivityIsDependentOn[j]
72+
);
73+
this.graphData['links'].push({
74+
source: activitysThatCurrenActivityIsDependentOn[j],
75+
target: activity,
76+
});
77+
this.populateGraphWithActivitiesCurrentActivityDependsOn(
78+
activitysThatCurrenActivityIsDependentOn[j]
79+
);
80+
}
7981
}
8082
} catch (e) {
8183
console.log(e);

0 commit comments

Comments
 (0)