@@ -62,10 +62,10 @@ const createNodes = (
6262const createEdges = ( childNodes : NodeModel [ ] ) : EdgeModel [ ] => {
6363 const edges : EdgeModel [ ] = [ ] ;
6464
65- childNodes . forEach ( ( sourceNode ) => {
65+ childNodes ? .forEach ( ( sourceNode ) => {
6666 // Find bridge connections
6767 if ( ! isEmpty ( sourceNode . data ?. bridgePorts ) ) {
68- sourceNode . data ?. bridgePorts . forEach ( ( port ) => {
68+ sourceNode . data ?. bridgePorts ? .forEach ( ( port ) => {
6969 const targetNode = childNodes . find (
7070 ( target ) => target . label === port . name && target . id !== sourceNode . id ,
7171 ) ;
@@ -82,8 +82,8 @@ const createEdges = (childNodes: NodeModel[]): EdgeModel[] => {
8282 }
8383
8484 // Find bond connections
85- if ( ! isEmpty ( sourceNode . data ?. vlanBaseInterface ) ) {
86- sourceNode . data ?. bondPorts . forEach ( ( port ) => {
85+ if ( ! isEmpty ( sourceNode . data ?. bondPorts ) ) {
86+ sourceNode . data ?. bondPorts ? .forEach ( ( port ) => {
8787 const targetNode = childNodes . find (
8888 ( target ) => target . label === port && target . id !== sourceNode . id ,
8989 ) ;
@@ -100,7 +100,7 @@ const createEdges = (childNodes: NodeModel[]): EdgeModel[] => {
100100 }
101101
102102 // Find vlan connections
103- if ( ! isEmpty ( sourceNode . data ?. bondPorts ) ) {
103+ if ( ! isEmpty ( sourceNode . data ?. vlanBaseInterface ) ) {
104104 const baseInterface = sourceNode . data ?. vlanBaseInterface ;
105105
106106 const targetNode = childNodes . find (
@@ -145,7 +145,7 @@ export const transformDataToTopologyModel = (
145145 const nodes : NodeModel [ ] = [ ] ;
146146 const edges : EdgeModel [ ] = [ ] ;
147147
148- data . forEach ( ( nodeState ) => {
148+ data ? .forEach ( ( nodeState ) => {
149149 const nnsName = nodeState . metadata . name ;
150150
151151 const childNodes = createNodes ( nnsName , nodeState . status . currentState . interfaces ) ;
0 commit comments