Skip to content

Commit

Permalink
Merge PR #4919: Fix GetConfirmation User Input Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
haasted authored and alexanderbez committed Aug 20, 2019
1 parent a6f265c commit 1a2bd70
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ Ref: https://keepachangelog.com/en/1.0.0/
* Update `handleQueryStore` to resemble `handleQueryCustom`
* (simulation) [\#4912](https://github.com/cosmos/cosmos-sdk/issues/4912) Fix SimApp ModuleAccountAddrs
to properly return black listed addresses for bank keeper initialization.
* (cli) [\#4919](https://github.com/cosmos/cosmos-sdk/pull/4919) Don't crash CLI
if user doesn't answer y/n confirmation request.

## [v0.36.0] - 2019-08-13

Expand Down
7 changes: 6 additions & 1 deletion client/input/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,12 @@ func GetConfirmation(prompt string, buf *bufio.Reader) (bool, error) {
return false, err
}

response = strings.ToLower(strings.TrimSpace(response))
response = strings.TrimSpace(response)
if len(response) == 0 {
return false, nil
}

response = strings.ToLower(response)
if response[0] == 'y' {
return true, nil
}
Expand Down

0 comments on commit 1a2bd70

Please sign in to comment.