Skip to content

Commit

Permalink
Merge pull request #7 from ethpandaops/fix-nil-check
Browse files Browse the repository at this point in the history
fix: only compare previous block number if there's a run
  • Loading branch information
skylenet authored Jan 29, 2025
2 parents 36c98d6 + 0f15ac3 commit 9f39b6a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/snapshotter/snapshotter.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ func (s *SnapShotter) StartPeriodicPolling() {

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

0 comments on commit 9f39b6a

Please sign in to comment.