Skip to content

Commit

Permalink
fix client initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
tyiuhc committed Feb 2, 2024
1 parent 7636747 commit dde24da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/experiment/local/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type Client struct {
func Initialize(apiKey string, config *Config) *Client {
initMutex.Lock()
var usedKey string
if config.DeploymentKey == "" {
if config == nil || config.DeploymentKey == "" {
usedKey = apiKey
} else {
usedKey = config.DeploymentKey
Expand Down
2 changes: 1 addition & 1 deletion pkg/experiment/remote/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type Client struct {
func Initialize(apiKey string, config *Config) *Client {
initMutex.Lock()
var usedKey string
if config.DeploymentKey == "" {
if config == nil || config.DeploymentKey == "" {
usedKey = apiKey
} else {
usedKey = config.DeploymentKey
Expand Down

0 comments on commit dde24da

Please sign in to comment.