Skip to content

Commit

Permalink
fix: nil pointer in network checker of liqoctl info peer
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiolor authored and aleoli committed Nov 19, 2024
1 parent 5201cd5 commit 22f77f2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/liqoctl/info/peer/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,10 @@ func (nc *NetworkChecker) collectGatewayInfo(ctx context.Context, cl client.Clie
peerNetwork.Gateway.Port = gwClient.Spec.Endpoint.Port
case gwServer != nil:
peerNetwork.Gateway.Role = GatewayClientType
peerNetwork.Gateway.Address = gwServer.Status.Endpoint.Addresses
peerNetwork.Gateway.Port = gwServer.Status.Endpoint.Port
if gwServer.Status.Endpoint != nil {
peerNetwork.Gateway.Address = gwServer.Status.Endpoint.Addresses
peerNetwork.Gateway.Port = gwServer.Status.Endpoint.Port
}
default:
return fmt.Errorf("no gateways found")
}
Expand Down

0 comments on commit 22f77f2

Please sign in to comment.