Skip to content

Commit

Permalink
fix: guard against a nil roll forward message (#790)
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Gianelloni <wolf31o2@blinklabs.io>
  • Loading branch information
wolf31o2 authored Nov 14, 2024
1 parent 7e0a43b commit a307899
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions protocol/chainsync/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,17 @@ func (s *Server) RollForward(blockType uint, blockData []byte, tip Tip) error {
blockData,
tip,
)
if msg == nil {
s.Protocol.Logger().
Error(
"failed to create roll forward message",
"component", "network",
"protocol", ProtocolName,
"role", "server",
"connection_id", s.callbackContext.ConnectionId.String(),
)
return fmt.Errorf("failed to create roll forward message")
}
return s.SendMessage(msg)
}
}
Expand Down

0 comments on commit a307899

Please sign in to comment.