From bfcb214c556f54de817cd643be0c485585a6c72b Mon Sep 17 00:00:00 2001 From: rigelrozanski Date: Tue, 3 Apr 2018 13:03:49 -0400 Subject: [PATCH] fix nil.Result() call --- x/stake/handler.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/x/stake/handler.go b/x/stake/handler.go index 82554d86ca..16db47b011 100644 --- a/x/stake/handler.go +++ b/x/stake/handler.go @@ -95,7 +95,11 @@ func handleMsgDeclareCandidacy(ctx sdk.Context, msg MsgDeclareCandidacy, k Keepe // move coins from the msg.Address account to a (self-bond) delegator account // the candidate account and global shares are updated within here - return delegate(ctx, k, msg.CandidateAddr, msg.Bond, candidate).Result() + err := delegate(ctx, k, msg.CandidateAddr, msg.Bond, candidate) + if err != nil { + return err.Result() + } + return sdk.Result{} } func handleMsgEditCandidacy(ctx sdk.Context, msg MsgEditCandidacy, k Keeper) sdk.Result { @@ -139,7 +143,11 @@ func handleMsgDelegate(ctx sdk.Context, msg MsgDelegate, k Keeper) sdk.Result { GasUsed: GasDelegate, } } - return delegate(ctx, k, msg.DelegatorAddr, msg.Bond, candidate).Result() + err := delegate(ctx, k, msg.DelegatorAddr, msg.Bond, candidate) + if err != nil { + return err.Result() + } + return sdk.Result{} } func delegate(ctx sdk.Context, k Keeper, delegatorAddr sdk.Address,