Skip to content

Commit d8106db

Browse files
committed
fix potential panic
1 parent 5e28fc2 commit d8106db

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

relayer/relayer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ func (r *Client) Relay(ctx context.Context, signedTxs *sequence.SignedTransactio
249249
var authorization *proto.EIP7702Authorization
250250
if signedTxs.Authorization != nil {
251251
chainID := signedTxs.Authorization.ChainID.Uint64()
252-
if chainID != 0 && signedTxs.ChainID.Uint64() != chainID {
252+
if chainID != 0 && signedTxs.ChainID != nil && signedTxs.ChainID.Uint64() != chainID {
253253
return "", nil, nil, fmt.Errorf("chain ID mismatch between signed transactions and authorization")
254254
}
255255

@@ -309,7 +309,7 @@ func (r *Client) FeeOptions(ctx context.Context, signedTxs *sequence.SignedTrans
309309
var authorization *proto.EIP7702Authorization
310310
if signedTxs.Authorization != nil {
311311
chainID := signedTxs.Authorization.ChainID.Uint64()
312-
if chainID != 0 && signedTxs.ChainID.Uint64() != chainID {
312+
if chainID != 0 && signedTxs.ChainID != nil && signedTxs.ChainID.Uint64() != chainID {
313313
return nil, nil, fmt.Errorf("chain ID mismatch between signed transactions and authorization")
314314
}
315315

0 commit comments

Comments
 (0)