diff --git a/xeth/types.go b/xeth/types.go index 739092474..1be5e109c 100644 --- a/xeth/types.go +++ b/xeth/types.go @@ -140,8 +140,11 @@ type Transaction struct { func NewTx(tx *types.Transaction) *Transaction { hash := tx.Hash().Hex() - receiver := tx.To().Hex() - if len(receiver) == 0 { + + var receiver string + if to := tx.To(); to != nil { + receiver = to.Hex() + } else { receiver = core.AddressFromMessage(tx).Hex() } sender, _ := tx.From()