Skip to content

Commit

Permalink
check if err is not nil first before checking error prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
maidul98 committed Jan 10, 2023
1 parent 60a03ca commit 9aa8bfa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cli/packages/cmd/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ var loginCmd = &cobra.Command{
PreRun: toggleDebug,
Run: func(cmd *cobra.Command, args []string) {
currentLoggedInUserDetails, err := util.GetCurrentLoggedInUserDetails()
if strings.Contains(err.Error(), "The specified item could not be found in the keyring") { // if the key can't be found allow them to override
if err != nil && strings.Contains(err.Error(), "The specified item could not be found in the keyring") { // if the key can't be found allow them to override
log.Debug(err)
} else {
} else if err != nil {
util.HandleError(err)
}

Expand Down

0 comments on commit 9aa8bfa

Please sign in to comment.