Skip to content

Commit

Permalink
add nil check (#510)
Browse files Browse the repository at this point in the history
  • Loading branch information
potterbm-cb authored Nov 25, 2024
1 parent dab4a57 commit 945092d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion asserter/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ func (a *Asserter) Block(

// Only apply duplicate hash and index checks if the block index is not the
// genesis index.
if a.genesisBlock.Index != block.BlockIdentifier.Index {
if a.genesisBlock == nil || a.genesisBlock.Index != block.BlockIdentifier.Index {
if block.BlockIdentifier.Hash == block.ParentBlockIdentifier.Hash {
return ErrBlockHashEqualsParentBlockHash
}
Expand Down

0 comments on commit 945092d

Please sign in to comment.