Skip to content

Commit 3981b08

Browse files
committed
prevent nil pointer dereference on renaming attempt
1 parent 992de5d commit 3981b08

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

client/router_update.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ func (cli *VanClient) RouterUpdateVersionInNamespace(ctx context.Context, hup bo
130130
if err != nil && !errors.IsAlreadyExists(err) {
131131
return false, err
132132
}
133-
consoleUsesLoadbalancer = controllerSvc.Spec.Type == corev1.ServiceTypeLoadBalancer
133+
if controllerSvc != nil {
134+
consoleUsesLoadbalancer = controllerSvc.Spec.Type == corev1.ServiceTypeLoadBalancer
135+
}
134136
//update annotation on skupper-router-console if it exists
135137
routerConsoleService, err := cli.KubeClient.CoreV1().Services(namespace).Get(types.RouterConsoleServiceName, metav1.GetOptions{})
136138
if err == nil {

0 commit comments

Comments
 (0)