Skip to content

Commit

Permalink
stake/client: Fix panic on if validator doesn't exist
Browse files Browse the repository at this point in the history
Closes #1505
  • Loading branch information
ValarDragon committed Jul 6, 2018
1 parent 6ea47f4 commit 8fc6e68
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ BUG FIXES
* \#1258 - printing big.rat's can no longer overflow int64
* \#887 - limit the size of rationals that can be passed in from user input
* \#1461 - CLI tests now no longer reset your local environment data
* \#1505 - `gaiacli stake validator` no longer panics if validator doesn't exist

## 0.19.0

Expand Down
3 changes: 2 additions & 1 deletion x/stake/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ func GetCmdQueryValidator(storeName string, cdc *wire.Codec) *cobra.Command {
res, err := ctx.QueryStore(key, storeName)
if err != nil {
return err
} else if len(res) == 0 {
return fmt.Errorf("No validator found with address %s", args[0])
}

validator := types.MustUnmarshalValidator(cdc, addr, res)

switch viper.Get(cli.OutputFlag) {
Expand Down

0 comments on commit 8fc6e68

Please sign in to comment.