Merge PR #3806: Fix nil returned in Unmarshal functions
* Fix nils returned in unmarshal functions * Address comments
This commit is contained in:
parent
dcc3357ea3
commit
805e7fbfc2
|
@ -107,6 +107,7 @@ CLI flag.
|
||||||
### Gaia
|
### Gaia
|
||||||
|
|
||||||
* [\#3777](https://github.com/cosmso/cosmos-sdk/pull/3777) `gaiad export` no longer panics when the database is empty
|
* [\#3777](https://github.com/cosmso/cosmos-sdk/pull/3777) `gaiad export` no longer panics when the database is empty
|
||||||
|
* [\#3806](https://github.com/cosmos/cosmos-sdk/pull/3806) Properly return errors from a couple of struct Unmarshal functions
|
||||||
|
|
||||||
### SDK
|
### SDK
|
||||||
|
|
||||||
|
|
|
@ -279,7 +279,7 @@ func (va *ValAddress) UnmarshalJSON(data []byte) error {
|
||||||
|
|
||||||
err := json.Unmarshal(data, &s)
|
err := json.Unmarshal(data, &s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
va2, err := ValAddressFromBech32(s)
|
va2, err := ValAddressFromBech32(s)
|
||||||
|
@ -415,7 +415,7 @@ func (ca *ConsAddress) UnmarshalJSON(data []byte) error {
|
||||||
|
|
||||||
err := json.Unmarshal(data, &s)
|
err := json.Unmarshal(data, &s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
ca2, err := ConsAddressFromBech32(s)
|
ca2, err := ConsAddressFromBech32(s)
|
||||||
|
|
|
@ -135,7 +135,7 @@ func (vo *VoteOption) UnmarshalJSON(data []byte) error {
|
||||||
var s string
|
var s string
|
||||||
err := json.Unmarshal(data, &s)
|
err := json.Unmarshal(data, &s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
bz2, err := VoteOptionFromString(s)
|
bz2, err := VoteOptionFromString(s)
|
||||||
|
|
|
@ -206,7 +206,7 @@ func (pt *ProposalKind) UnmarshalJSON(data []byte) error {
|
||||||
var s string
|
var s string
|
||||||
err := json.Unmarshal(data, &s)
|
err := json.Unmarshal(data, &s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
bz2, err := ProposalTypeFromString(s)
|
bz2, err := ProposalTypeFromString(s)
|
||||||
|
@ -307,7 +307,7 @@ func (status *ProposalStatus) UnmarshalJSON(data []byte) error {
|
||||||
var s string
|
var s string
|
||||||
err := json.Unmarshal(data, &s)
|
err := json.Unmarshal(data, &s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
bz2, err := ProposalStatusFromString(s)
|
bz2, err := ProposalStatusFromString(s)
|
||||||
|
|
Loading…
Reference in New Issue