Skip to content

Commit 7bdca61

Browse files
claudiolorfra98
authored andcommitted
fix: nil pointer in network checker of liqoctl info peer
1 parent 373dc94 commit 7bdca61

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pkg/liqoctl/info/peer/network.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,10 @@ func (nc *NetworkChecker) collectGatewayInfo(ctx context.Context, cl client.Clie
180180
peerNetwork.Gateway.Port = gwClient.Spec.Endpoint.Port
181181
case gwServer != nil:
182182
peerNetwork.Gateway.Role = GatewayClientType
183-
peerNetwork.Gateway.Address = gwServer.Status.Endpoint.Addresses
184-
peerNetwork.Gateway.Port = gwServer.Status.Endpoint.Port
183+
if gwServer.Status.Endpoint != nil {
184+
peerNetwork.Gateway.Address = gwServer.Status.Endpoint.Addresses
185+
peerNetwork.Gateway.Port = gwServer.Status.Endpoint.Port
186+
}
185187
default:
186188
return fmt.Errorf("no gateways found")
187189
}

0 commit comments

Comments
 (0)