From 3aa9d671aec0f777a7f668ca2b2ceb37218fb6bb Mon Sep 17 00:00:00 2001 From: Marco Munizaga Date: Thu, 2 May 2024 09:41:05 -0700 Subject: [PATCH] fix: Don't bother parsing an empty slice (#556) --- comm.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/comm.go b/comm.go index b313943e..2dee9b2e 100644 --- a/comm.go +++ b/comm.go @@ -77,6 +77,9 @@ func (p *PubSub) handleNewStream(s network.Stream) { return } + if len(msgbytes) == 0 { + continue + } rpc := new(RPC) err = rpc.Unmarshal(msgbytes)