Skip to content

Commit

Permalink
fix: Support selecting 0 keys from the UI prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
WillFantom committed Jan 28, 2023
1 parent e0d15dc commit 4b782db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/ui/prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ func SelectKey(authKeys []*keys.Key) ([]*keys.Key, error) {
if err := survey.AskOne(&ms, &chosenKeyOptions); err != nil {
return nil, fmt.Errorf("prompt exited")
}
chosenKeys := make([]*keys.Key, len(chosenKeyOptions))
if len(chosenKeyOptions) <= 0 {
return nil, fmt.Errorf("no keys were selected")
return nil, nil
}
chosenKeys := make([]*keys.Key, len(chosenKeyOptions))
for idx, ck := range chosenKeyOptions {
keyIndex, err := strconv.Atoi(strings.SplitN(ck, ".", 2)[0])
if err != nil {
Expand Down

0 comments on commit 4b782db

Please sign in to comment.