Skip to content

Commit 23ba409

Browse files
committed
Fix: undefined global assets
1 parent 34f1ae1 commit 23ba409

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/app/configuration/mydata/mydata.component.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ export class MyDataComponent implements OnInit {
2626
this.assetGroups = [];
2727
if (this.myData.IsProjectData) {
2828
const glob = this.dataService.Project.GetProjectAssetGroup();
29-
let g: IKeyValue = {
30-
Key: glob.Name,
31-
Value: [glob, ...glob.GetGroupsFlat()]
29+
if (glob) {
30+
const g: IKeyValue = {
31+
Key: glob.Name,
32+
Value: [glob, ...glob.GetGroupsFlat()]
33+
}
34+
this.assetGroups.push(g);
3235
}
33-
this.assetGroups.push(g);
3436
this.dataService.Project.GetDevices().filter(x => x.AssetGroup).forEach(dev => {
3537
let g: IKeyValue = {
3638
Key: dev.Name,

0 commit comments

Comments
 (0)