Skip to content

Commit

Permalink
Fix: fix possible nil pointer exception
Browse files Browse the repository at this point in the history
  • Loading branch information
hmoog committed Dec 3, 2023
1 parent 75240f0 commit e83a78e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/protocol/commitment.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func (c *Commitment) deriveReplayDroppedBlocks(chain *Chain) func() {
// the parent is on the target Chain.
func (c *Commitment) forceChain(targetChain *Chain) {
if currentChain := c.Chain.Get(); currentChain != targetChain {
if parent := c.Parent.Get(); parent.Chain.Get() == targetChain {
if parent := c.Parent.Get(); parent != nil && parent.Chain.Get() == targetChain {
parent.MainChild.Set(c)
}
}
Expand Down

0 comments on commit e83a78e

Please sign in to comment.