Skip to content

Commit e03b5ad

Browse files
core/types: fix nil pointer exception
1 parent ea9cf1b commit e03b5ad

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/types/tx_blob_with_blob.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ type innerType struct {
3535
}
3636

3737
func (tx *BlobTxWithBlobs) DecodeRLP(s *rlp.Stream) error {
38+
tx.Transaction = new(Transaction)
3839
kind, _, err := s.Kind()
3940
switch {
4041
case err != nil:
4142
return err
4243
case kind == rlp.List:
43-
tx.Transaction = new(Transaction)
4444
return tx.Transaction.DecodeRLP(s)
4545
default:
4646
b, err := s.Bytes()
@@ -79,6 +79,7 @@ func (tx *BlobTxWithBlobs) EncodeRLP(w io.Writer) error {
7979
}
8080

8181
func (tx *BlobTxWithBlobs) UnmarshalBinary(b []byte) error {
82+
tx.Transaction = new(Transaction)
8283
if len(b) < 1 {
8384
return errShortTypedTx
8485
}

0 commit comments

Comments
 (0)