Merge PR #3806: Fix nil returned in Unmarshal functions
* Fix nils returned in unmarshal functions * Address comments
This commit is contained in:
committed by
Christopher Goes
parent
dcc3357ea3
commit
805e7fbfc2
@@ -135,7 +135,7 @@ func (vo *VoteOption) UnmarshalJSON(data []byte) error {
|
||||
var s string
|
||||
err := json.Unmarshal(data, &s)
|
||||
if err != nil {
|
||||
return nil
|
||||
return err
|
||||
}
|
||||
|
||||
bz2, err := VoteOptionFromString(s)
|
||||
|
||||
+2
-2
@@ -206,7 +206,7 @@ func (pt *ProposalKind) UnmarshalJSON(data []byte) error {
|
||||
var s string
|
||||
err := json.Unmarshal(data, &s)
|
||||
if err != nil {
|
||||
return nil
|
||||
return err
|
||||
}
|
||||
|
||||
bz2, err := ProposalTypeFromString(s)
|
||||
@@ -307,7 +307,7 @@ func (status *ProposalStatus) UnmarshalJSON(data []byte) error {
|
||||
var s string
|
||||
err := json.Unmarshal(data, &s)
|
||||
if err != nil {
|
||||
return nil
|
||||
return err
|
||||
}
|
||||
|
||||
bz2, err := ProposalStatusFromString(s)
|
||||
|
||||
Reference in New Issue
Block a user