Skip to content

Commit 1e123e7

Browse files
committed
Fix NPE
1 parent e5b0798 commit 1e123e7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

common/commands/config.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ type ConfigCommand struct {
7070
}
7171

7272
func NewConfigCommand(cmdType ConfigAction, serverId string) *ConfigCommand {
73-
return &ConfigCommand{cmdType: cmdType, serverId: serverId, oidcSetupParams: &generic.OidcTokenParams{}}
73+
return &ConfigCommand{cmdType: cmdType, serverId: serverId}
7474
}
7575

7676
func (cc *ConfigCommand) SetServerId(serverId string) *ConfigCommand {
@@ -300,6 +300,7 @@ func (cc *ConfigCommand) prepareConfigurationData() ([]*config.ServerDetails, er
300300
if cc.defaultDetails != nil {
301301
cc.details.InsecureTls = cc.defaultDetails.InsecureTls
302302
}
303+
cc.oidcSetupParams = new(generic.OidcTokenParams)
303304
}
304305

305306
// Get configurations list
@@ -509,7 +510,7 @@ func (cc *ConfigCommand) SetOidcExchangeTokenId(id string) {
509510

510511
// Provider name must be set in order to use OIDC integration
511512
func (cc *ConfigCommand) UsesOidc() bool {
512-
return cc.oidcSetupParams.ProviderName != ""
513+
return cc.oidcSetupParams != nil && cc.oidcSetupParams.ProviderName != ""
513514
}
514515

515516
func readAccessTokenFromConsole(details *config.ServerDetails) error {

0 commit comments

Comments
 (0)