From 1a74d9a377f12ff18407dfab16e1e1bf11aee4de Mon Sep 17 00:00:00 2001 From: Kolby Moroz Liebl <31669092+KolbyML@users.noreply.github.com> Date: Thu, 4 Dec 2025 10:03:47 -0700 Subject: [PATCH] Add null check to Transaction.MarshalBinary() --- core/types/transaction.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/types/transaction.go b/core/types/transaction.go index 337ab4666d..f4adfab06e 100644 --- a/core/types/transaction.go +++ b/core/types/transaction.go @@ -184,6 +184,9 @@ func (tx *Transaction) encodeTyped(w *bytes.Buffer) error { // For legacy transactions, it returns the RLP encoding. For EIP-2718 typed // transactions, it returns the type and payload. func (tx *Transaction) MarshalBinary() ([]byte, error) { + if tx.inner == nil { + return nil, fmt.Errorf("tx inner data is nil") + } if tx.Type() == LegacyTxType { return rlp.EncodeToBytes(tx.inner) }