Skip to content

Commit d1657fb

Browse files
EtronieDENGpansgg
authored andcommitted
UI: fix defect of code in strict mode
1 parent 5242924 commit d1657fb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/app/components/graph/graph.component.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -632,10 +632,12 @@ export class GraphComponent implements AfterViewInit, OnChanges {
632632
let portDeviceType = "";
633633
let ports = [];
634634
if (unit) {
635-
ports = unit.inputports.concat(unit.outputports)
635+
ports = unit.inputports?.concat(unit.outputports)
636+
}
637+
let result;
638+
if (ports) {
639+
result = ports.filter(x => x.name === d.children[0].text);
636640
}
637-
638-
let result = ports.filter(x => x.name === d.children[0].text);
639641
if (result && result[0]) {
640642
portDeviceType = result[0].device_type;
641643
}

0 commit comments

Comments
 (0)