return after writing error response when owner address is invalid (#699)

This commit is contained in:
Nick DeLuca 2020-10-20 12:18:12 -05:00 committed by GitHub
parent fabeee93cc
commit c02ce618da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -67,6 +67,7 @@ func queryDepositsHandlerFn(cliCtx context.CLIContext) http.HandlerFunc {
depositOwner, err = sdk.AccAddressFromBech32(depositOwnerStr) depositOwner, err = sdk.AccAddressFromBech32(depositOwnerStr)
if err != nil { if err != nil {
rest.WriteErrorResponse(w, http.StatusBadRequest, fmt.Sprintf("cannot parse address from deposit owner %s", depositOwnerStr)) rest.WriteErrorResponse(w, http.StatusBadRequest, fmt.Sprintf("cannot parse address from deposit owner %s", depositOwnerStr))
return
} }
} }
@ -125,6 +126,7 @@ func queryClaimsHandlerFn(cliCtx context.CLIContext) http.HandlerFunc {
claimOwner, err = sdk.AccAddressFromBech32(claimOwnerStr) claimOwner, err = sdk.AccAddressFromBech32(claimOwnerStr)
if err != nil { if err != nil {
rest.WriteErrorResponse(w, http.StatusBadRequest, fmt.Sprintf("cannot parse address from claim owner %s", claimOwnerStr)) rest.WriteErrorResponse(w, http.StatusBadRequest, fmt.Sprintf("cannot parse address from claim owner %s", claimOwnerStr))
return
} }
} }