From c02ce618da3781c2460a1b292a0b02cbc65da3a0 Mon Sep 17 00:00:00 2001 From: Nick DeLuca Date: Tue, 20 Oct 2020 12:18:12 -0500 Subject: [PATCH] return after writing error response when owner address is invalid (#699) --- x/harvest/client/rest/query.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x/harvest/client/rest/query.go b/x/harvest/client/rest/query.go index a00e14d2..7bcf4eae 100644 --- a/x/harvest/client/rest/query.go +++ b/x/harvest/client/rest/query.go @@ -67,6 +67,7 @@ func queryDepositsHandlerFn(cliCtx context.CLIContext) http.HandlerFunc { depositOwner, err = sdk.AccAddressFromBech32(depositOwnerStr) if err != nil { 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) if err != nil { rest.WriteErrorResponse(w, http.StatusBadRequest, fmt.Sprintf("cannot parse address from claim owner %s", claimOwnerStr)) + return } }