Browse Source

nil check for ccp client

David Townley 2 years ago
parent
commit
b4e0e32120
1 changed files with 4 additions and 0 deletions
  1. 4 0
      internal/registry/registry.go

+ 4 - 0
internal/registry/registry.go

@@ -1759,6 +1759,10 @@ func (r *Registry) GetDockerConfigJSON(
 	}
 
 	if proj.CapiProvisionerEnabled && strings.Contains(r.URL, ".azurecr") {
+		if ccpClient == nil {
+			return nil, telemetry.Error(ctx, span, nil, "ccpClient cannot be nil")
+		}
+
 		dockerConfigReq := connect.NewRequest(&porterv1.DockerConfigFileForRegistryRequest{
 			ProjectId:   int64(proj.ID),
 			RegistryUri: r.URL,