fix: Don't bother parsing an empty slice (#556)

This commit is contained in:
Marco Munizaga
2024-05-02 09:41:05 -07:00
committed by GitHub
parent c0a528ee7b
commit 3aa9d671ae
+3
View File
@@ -77,6 +77,9 @@ func (p *PubSub) handleNewStream(s network.Stream) {
return
}
if len(msgbytes) == 0 {
continue
}
rpc := new(RPC)
err = rpc.Unmarshal(msgbytes)