From 22f77f2a964feb6583186aa29f8e6ad7e0b738b3 Mon Sep 17 00:00:00 2001 From: Claudio Lorina Date: Wed, 30 Oct 2024 15:14:48 +0100 Subject: [PATCH] fix: nil pointer in network checker of liqoctl info peer --- pkg/liqoctl/info/peer/network.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/liqoctl/info/peer/network.go b/pkg/liqoctl/info/peer/network.go index 3ceb2ba47f..177e68e0f1 100644 --- a/pkg/liqoctl/info/peer/network.go +++ b/pkg/liqoctl/info/peer/network.go @@ -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") }