From 1fd6e14885b9f7fb44b8aeefa5848f41fa06692e Mon Sep 17 00:00:00 2001 From: Leopold Schabel Date: Fri, 8 Apr 2022 13:32:05 +0200 Subject: [PATCH] node/pkg/ethereum: fix unreachable nil check The program would've crashed on `l.Address` before it could reach the nilness check. commit-id:17b64899 --- node/pkg/ethereum/by_transaction.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/node/pkg/ethereum/by_transaction.go b/node/pkg/ethereum/by_transaction.go index 753a16430..a2d25884a 100644 --- a/node/pkg/ethereum/by_transaction.go +++ b/node/pkg/ethereum/by_transaction.go @@ -60,12 +60,12 @@ func MessageEventsForTransaction( // Extract logs for _, l := range receipt.Logs { - // SECURITY: Skip logs not produced by our contract. - if l.Address != contract { + if l == nil { continue } - if l == nil { + // SECURITY: Skip logs not produced by our contract. + if l.Address != contract { continue }