From d7e83aad26cd86f15d9bc7a97af5e20e235c23b7 Mon Sep 17 00:00:00 2001 From: matias-portainer <104775949+matias-portainer@users.noreply.github.com> Date: Wed, 2 Aug 2023 11:06:34 -0300 Subject: [PATCH] fix(endpoints): fix nil pointer dereference EE-5843 (#9969) --- api/http/handler/endpoints/endpoint_update.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/http/handler/endpoints/endpoint_update.go b/api/http/handler/endpoints/endpoint_update.go index 6e2857363..4d566968c 100644 --- a/api/http/handler/endpoints/endpoint_update.go +++ b/api/http/handler/endpoints/endpoint_update.go @@ -294,7 +294,7 @@ func shouldReloadTLSConfiguration(endpoint *portainer.Endpoint, payload *endpoin // When updating Docker API environment, as long as TLS is true and TLSSkipVerify is false, // we assume that new TLS files have been uploaded and we need to reload the TLS configuration. if endpoint.Type != portainer.DockerEnvironment || - !strings.HasPrefix(*payload.URL, "tcp://") || + (payload.URL != nil && !strings.HasPrefix(*payload.URL, "tcp://")) || payload.TLS == nil || !*payload.TLS { return false }