Skip to content

Commit

Permalink
fix: possible nil tx caused panic
Browse files Browse the repository at this point in the history
  • Loading branch information
Candinya committed Jul 15, 2024
1 parent c36e972 commit a1e7892
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/service/indexer/l2/indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ func (s *server) processIndex(ctx context.Context, block *types.Block, receipts

for _, receipt := range receipts {
// Discard all contract creation transactions.
if block.Transaction(receipt.TxHash).To() == nil {
tx := block.Transaction(receipt.TxHash)
if tx == nil || tx.To() == nil {
continue
}

Expand Down

0 comments on commit a1e7892

Please sign in to comment.