Skip to content

Commit

Permalink
Merge pull request #93 from renproject/fix/nil-hint-panic
Browse files Browse the repository at this point in the history
fix nil point
  • Loading branch information
tok-kkk authored Apr 1, 2022
2 parents 6ab55b0 + cabae99 commit f6106a6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
go get -u github.com/loongy/covermerge
go get -u github.com/mattn/goveralls
cd $GITHUB_WORKSPACE
go mod tidy
go vet ./...
golint ./...
- name: Run tests and report test coverage
Expand Down
4 changes: 2 additions & 2 deletions aw.go
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ func (peer *Peer) handleEvent(e event) {
numErrors := 0
for _, recipient := range peers {
if err := peer.handleSendMessage(recipient, message); err != nil {
if recipient.Equal(e.hint) {
if e.hint != nil && recipient.Equal(e.hint) {
peer.Opts.Logger.Warn("unable to sync from hinted peer", zap.Error(err))
}
numErrors++
Expand Down Expand Up @@ -1229,7 +1229,7 @@ func (peer *Peer) handleSendMessage(remote id.Signatory, message wire.Msg) error
return nil

case <-ctx.Done():
if peer.ctx.Err() == nil {
if ctx.Err() == nil {
return ErrMessageBufferFull
} else {
return nil
Expand Down
1 change: 0 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/gorilla/websocket v1.4.1-0.20190629185528-ae1634f6a989/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
Expand Down

0 comments on commit f6106a6

Please sign in to comment.