Skip to content

Commit

Permalink
Check for zero valued progress
Browse files Browse the repository at this point in the history
  • Loading branch information
masih committed Dec 18, 2023
1 parent cebfa0f commit b0570ad
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion exchange/fx_exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,10 @@ func (e *FxExchange) Push(ctx context.Context, to peer.ID, l ipld.Link) error {
}
// Recursively traverse the node and push all its leaves.
err = traversal.WalkAdv(node, exploreAllRecursivelySelector, func(progress traversal.Progress, node datamodel.Node, _ traversal.VisitReason) error {
log := log.With("t-cid", progress.LastBlock.Link.(cidlink.Link).Cid)
log := log
if progress.LastBlock.Link != nil {
log = log.With("t-cid", progress.LastBlock.Link.(cidlink.Link).Cid)
}
var buf bytes.Buffer
err := dagcbor.Encode(node, &buf)
if err != nil {
Expand Down

0 comments on commit b0570ad

Please sign in to comment.