stake/client: Fix panic on if validator doesn't exist

Closes #1505
This commit is contained in:
ValarDragon 2018-07-05 18:24:00 -07:00
parent 6ea47f40ef
commit 8fc6e68511
2 changed files with 3 additions and 1 deletions

View File

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

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