Skip to content

Commit

Permalink
Fix potential nil pointer dereference in Validate().
Browse files Browse the repository at this point in the history
  • Loading branch information
ggreer committed Dec 27, 2024
1 parent 05864b6 commit 5bb2b65
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/connector/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
v2 "github.com/conductorone/baton-sdk/pb/c1/connector/v2"
"github.com/conductorone/baton-sdk/pkg/annotations"
"github.com/conductorone/baton-sdk/pkg/connectorbuilder"
"github.com/conductorone/baton-sdk/pkg/pagination"
)

type Connector struct {
Expand Down Expand Up @@ -47,7 +48,7 @@ func (c *Connector) Metadata(ctx context.Context) (*v2.ConnectorMetadata, error)
// Validate is called to ensure that the connector is properly configured. It should exercise any API credentials
// to be sure that they are valid.
func (c *Connector) Validate(ctx context.Context) (annotations.Annotations, error) {
_, _, err := c.client.GetProjects(ctx, nil)
_, _, err := c.client.GetProjects(ctx, &pagination.Token{})
return nil, err
}

Expand Down

0 comments on commit 5bb2b65

Please sign in to comment.