Skip to content

Commit

Permalink
fix nil dereference error
Browse files Browse the repository at this point in the history
  • Loading branch information
parketh committed Nov 6, 2024
1 parent 39e3f8a commit ec85593
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion finalitygadget/finalitygadget.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ func (fg *FinalityGadget) Startup(ctx context.Context) error {
return fmt.Errorf("error fetching latest finalized block from db: %w", err)
}
fg.lastProcessedHeight = latestFinalizedHeight - 1
if latestFinalizedBlockDb.BlockHeight > latestFinalizedHeight {
if latestFinalizedBlockDb != nil && latestFinalizedBlockDb.BlockHeight > latestFinalizedHeight {
fg.lastProcessedHeight = latestFinalizedBlockDb.BlockHeight
}
fg.logger.Info("Starting finality gadget from block", zap.Uint64("block_height", fg.lastProcessedHeight+1))
Expand Down

0 comments on commit ec85593

Please sign in to comment.