Skip to content

Commit

Permalink
Add Nil Check for Block Producer's Validator Entry Lookup (#1060)
Browse files Browse the repository at this point in the history
  • Loading branch information
tholonious authored Feb 22, 2024
1 parent cdd15ae commit 3dc58f3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/pos_consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,9 @@ func (fc *FastHotStuffConsensus) createBlockProducer(bav *UtxoView, previousBloc
if err != nil {
return nil, errors.Errorf("Error fetching validator entry for block producer: %v", err)
}
if blockProducerValidatorEntry == nil {
return nil, errors.New("Error fetching validator entry for block producer")
}
blockProducerPublicKeyBytes := bav.GetPublicKeyForPKID(blockProducerValidatorEntry.PKID)
blockProducerPublicKey := NewPublicKey(blockProducerPublicKeyBytes)
if blockProducerPublicKey == nil {
Expand Down

0 comments on commit 3dc58f3

Please sign in to comment.