diff --git a/chain/events/filter/index.go b/chain/events/filter/index.go index 45cabaa11..1920a91fe 100644 --- a/chain/events/filter/index.go +++ b/chain/events/filter/index.go @@ -225,7 +225,7 @@ func (ei *EventIndex) CollectEvents(ctx context.Context, te *TipSetEvents, rever // This function swallows errors and returns the original array if it failed // to decode. func decodeLogBytes(orig []byte) []byte { - if orig == nil { + if len(orig) == 0 { return orig } decoded, err := cbg.ReadByteArray(bytes.NewReader(orig), uint64(len(orig))) diff --git a/itests/eth_filter_test.go b/itests/eth_filter_test.go index 05201dcf6..a3bc3e04e 100644 --- a/itests/eth_filter_test.go +++ b/itests/eth_filter_test.go @@ -1909,7 +1909,7 @@ func ParseEthLog(in map[string]interface{}) (*ethtypes.EthLog, error) { } func decodeLogBytes(orig []byte) []byte { - if orig == nil { + if len(orig) == 0 { return orig } decoded, err := cbg.ReadByteArray(bytes.NewReader(orig), uint64(len(orig)))