Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Update run.go

Daniel Hougaardde92ba157a9d
diff --git a/cli/packages/cmd/run.go b/cli/packages/cmd/run.go
index 3fe151d0b9..04fe2588b6 100644
--- a/cli/packages/cmd/run.go
+++ b/cli/packages/cmd/run.go
@@ -179,8 +179,8 @@ var runCmd = &cobra.Command{
posthog.NewProperties().
Set("secretsCount", len(secrets)).
Set("environment", environmentName).
- Set("isUsingServiceToken", token.Type == util.SERVICE_TOKEN_IDENTIFIER).
- Set("isUsingUniversalAuthToken", token.Type == util.UNIVERSAL_AUTH_TOKEN_IDENTIFIER).
+ Set("isUsingServiceToken", token != nil && token.Type == util.SERVICE_TOKEN_IDENTIFIER).
+ Set("isUsingUniversalAuthToken", token != nil && token.Type == util.UNIVERSAL_AUTH_TOKEN_IDENTIFIER).
Set("single-command", strings.Join(args, " ")).
Set("multi-command", cmd.Flag("command").Value.String()).
Set("version", util.CLI_VERSION))