use len to conduct empty byte array checks.
This commit is contained in:
parent
f2ab452eb8
commit
2a9069200d
@ -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)))
|
||||
|
@ -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)))
|
||||
|
Loading…
Reference in New Issue
Block a user