Skip to content

Commit ed0c258

Browse files
Fix: Prevent crash when YamlObject is null in matrix component
1 parent d4598f1 commit ed0c258

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

angular.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
},
117117
"defaultProject": "DSOMM",
118118
"cli": {
119-
"defaultCollection": "@angular-eslint/schematics"
119+
"defaultCollection": "@angular-eslint/schematics",
120+
"analytics": false
120121
}
121122
}

src/app/component/matrix/matrix.component.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ export class MatrixComponent implements OnInit {
8282
this.yaml.getJson().subscribe(data => {
8383
this.YamlObject = data;
8484

85-
this.allDimensionNames = Object.keys(this.YamlObject);
85+
this.allDimensionNames = this.YamlObject ? Object.keys(this.YamlObject) : [];
86+
8687
for (let i = 0; i < this.allDimensionNames.length; i++) {
8788
var subdimensionsInCurrentDimension = Object.keys(
8889
this.YamlObject[this.allDimensionNames[i]]

0 commit comments

Comments
 (0)