use len to conduct empty byte array checks.

This commit is contained in:
Raúl Kripalani 2023-01-20 00:57:49 +00:00
parent f2ab452eb8
commit 2a9069200d
2 changed files with 2 additions and 2 deletions

View File

@ -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)))

View File

@ -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)))