Merge PR #1570: stake/client: Fix panic on if validator doesn't exist

This commit is contained in:
Christopher Goes 2018-07-06 04:26:39 +02:00 committed by GitHub
commit 1f3ab377ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -103,6 +103,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

View File

@ -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) {