Skip to content

Commit 5f29e22

Browse files
committed
fix nil pointer if there's no pending batches
1 parent 97de988 commit 5f29e22

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

rollup/internal/controller/relayer/l2_relayer.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,11 @@ func (r *Layer2Relayer) ProcessPendingBatches() {
327327
return
328328
}
329329

330+
// nothing to do if we don't have any pending batches
331+
if len(dbBatches) == 0 {
332+
return
333+
}
334+
330335
// if backlog outgrow max size, force‐submit enough oldest batches
331336
backlogCount, err := r.batchOrm.GetFailedAndPendingBatchesCount(r.ctx)
332337
if err != nil {

0 commit comments

Comments
 (0)