Skip to content

Commit 3aa9d67

Browse files
authored
fix: Don't bother parsing an empty slice (#556)
1 parent c0a528e commit 3aa9d67

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

comm.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ func (p *PubSub) handleNewStream(s network.Stream) {
7777

7878
return
7979
}
80+
if len(msgbytes) == 0 {
81+
continue
82+
}
8083

8184
rpc := new(RPC)
8285
err = rpc.Unmarshal(msgbytes)

0 commit comments

Comments
 (0)