Skip to content

Commit

Permalink
adding a nil check on the trace.Receipt and if the log of the receipt…
Browse files Browse the repository at this point in the history
… is nil
  • Loading branch information
Eduard-Voiculescu committed Oct 29, 2024
1 parent b0b1504 commit cda7202
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions transform/combined_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,13 @@ func getcombinedFilterFunc(callFilters []*CallToFilter, logFilters []*LogFilter)

func logKeys(trace *pbeth.TransactionTrace, prefix string) map[string]bool {
out := make(map[string]bool)
if trace.Receipt == nil {
return out
}
for _, log := range trace.Receipt.Logs {
if log == nil {
continue
}
out[prefix+hex.EncodeToString(log.Address)] = true
if len(log.Topics) != 0 {
out[prefix+hex.EncodeToString(log.Topics[0])] = true
Expand Down

0 comments on commit cda7202

Please sign in to comment.