Skip to content

Commit 9f39b6a

Browse files
authored
Merge pull request #7 from ethpandaops/fix-nil-check
fix: only compare previous block number if there's a run
2 parents 36c98d6 + 0f15ac3 commit 9f39b6a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/snapshotter/snapshotter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ func (s *SnapShotter) StartPeriodicPolling() {
304304

305305
// If the most recent run is far away from the current block number, we need to create a new snapshot
306306
lastRunIsTooOld := false
307-
if blockNumber > run.BlockHeight+uint64(s.cfg.Global.Snapshots.BlockInterval) {
307+
if run != nil && blockNumber > run.BlockHeight+uint64(s.cfg.Global.Snapshots.BlockInterval) {
308308
lastRunIsTooOld = true
309309
log.WithFields(log.Fields{
310310
"run_id": run.ID,

0 commit comments

Comments
 (0)