From d5d1d434eff0a78a630e406a745756d679110f3c Mon Sep 17 00:00:00 2001 From: Valentin Staykov <79150443+V-Staykov@users.noreply.github.com> Date: Wed, 25 Sep 2024 13:27:02 +0300 Subject: [PATCH] check for nil sequences in getAccInputHash (#1224) --- cmd/rpcdaemon/commands/zkevm_api.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/rpcdaemon/commands/zkevm_api.go b/cmd/rpcdaemon/commands/zkevm_api.go index c40a764a3f4..cacdbe257d9 100644 --- a/cmd/rpcdaemon/commands/zkevm_api.go +++ b/cmd/rpcdaemon/commands/zkevm_api.go @@ -747,6 +747,10 @@ func (api *ZkEvmAPIImpl) getAccInputHash(ctx context.Context, db SequenceReader, return nil, fmt.Errorf("failed to get sequence range data for batch %d: %w", batchNum, err) } + if prevSequence == nil || batchSequence == nil { + return nil, fmt.Errorf("failed to get sequence data for batch %d", batchNum) + } + // get batch range for sequence prevSequenceBatch, currentSequenceBatch := prevSequence.BatchNo, batchSequence.BatchNo // get call data for tx