Skip to content

Commit

Permalink
refactor: return nil instead of an empty record when processing an in…
Browse files Browse the repository at this point in the history
…valid record
  • Loading branch information
aschmahmann committed Oct 7, 2020
1 parent 773aa01 commit b0dc23d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions wire/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ func (pm *ProtocolMessenger) GetValue(ctx context.Context, p peer.ID, key string
if err != nil {
logger.Debug("received invalid record (discarded)")
// return a sentinel to signify an invalid record was received
err = internal.ErrInvalidRecord
rec = new(recpb.Record)
return nil, peers, internal.ErrInvalidRecord
}
return rec, peers, err
}
Expand Down

0 comments on commit b0dc23d

Please sign in to comment.