Skip to content

Commit

Permalink
fix: Don't bother parsing an empty slice (#556)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoPolo committed May 2, 2024
1 parent c0a528e commit 3aa9d67
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions comm.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ func (p *PubSub) handleNewStream(s network.Stream) {

return
}
if len(msgbytes) == 0 {
continue
}

rpc := new(RPC)
err = rpc.Unmarshal(msgbytes)
Expand Down

0 comments on commit 3aa9d67

Please sign in to comment.