Skip to content

Commit

Permalink
Fix nft-transfer bug (#2662)
Browse files Browse the repository at this point in the history
* fix nft-transfer bug

* solve the problem of if nesting and err

Co-authored-by: vincent <[email protected]>
  • Loading branch information
mindcarver and chengwenxi authored Aug 27, 2021
1 parent e92f052 commit 2584b6f
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions cmd/iris/cmd/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,21 @@ func (it coinConverter) parseFlags(cmd *cobra.Command, flag *pflag.Flag, cmdNm s
}

func (it coinConverter) parseArgs(cmd *cobra.Command, args []string) {
command, ok := it.cmds[cmd.Name()]
if !ok {
return
}

if cmd.Parent().Name() != command.parentCmd {
return
}

if field, ok := it.getFromArgs(cmd.Name()); ok && len(args) > 0 {
if res, err := it.convertCoins(cmd, args[field.index]); err == nil {
args[field.index] = res
res, err := it.convertCoins(cmd, args[field.index])
if err != nil {
return
}
args[field.index] = res
}
}

Expand Down

0 comments on commit 2584b6f

Please sign in to comment.