Skip to content

Commit

Permalink
handle error to avoid runtime error: invalid memory address or nil po…
Browse files Browse the repository at this point in the history
…inter dereference
  • Loading branch information
zhanglin9833 committed May 12, 2024
1 parent 36a46c3 commit b0f5ed0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion v3/abi/bind/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,13 @@ func (c *BoundContract) TransactWithResult(opts *TransactOpts, result interface{
return nil, nil, err
}
tx, receipt, err := c.transact(opts, &c.address, input, "")
c.abi.Unpack(result, method, common.FromHex(receipt.GetOutput()))
if err != nil {
return tx, receipt, err
}
err = c.abi.Unpack(result, method, common.FromHex(receipt.GetOutput()))
if err != nil {
return tx, receipt, err
}
return tx, receipt, err
}

Expand Down

0 comments on commit b0f5ed0

Please sign in to comment.