Skip to content

Commit

Permalink
hotfix: change input validation
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkresnofatih committed Mar 20, 2023
1 parent 5fa9b62 commit 1f044a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xata/Provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ func Provider() *schema.Provider {
ConfigureContextFunc: func(ctx context.Context, data *schema.ResourceData) (interface{}, diag.Diagnostics) {
var diags diag.Diagnostics
apiKey := data.Get("api_key").(string)
if len(apiKey) > 0 {
return nil, diag.FromErr(errors.New("create api key"))
if len(apiKey) == 0 {
return nil, diag.FromErr(errors.New("api key is empty"))
}
return base.XataApi{
ApiKey: apiKey,
Expand Down

0 comments on commit 1f044a6

Please sign in to comment.