From 1df592cb81069d27cbe86944b49d82a9839dfd09 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sat, 28 Apr 2018 18:08:36 +0200 Subject: [PATCH] fix condition error --- cmd/iface/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/iface/main.go b/cmd/iface/main.go index acf80d5..1f88082 100644 --- a/cmd/iface/main.go +++ b/cmd/iface/main.go @@ -23,7 +23,9 @@ func main(){ select { case receivedFrame := <- receiver: fmt.Printf("[default] received '%s'\n", receivedFrame.Payload.Buffer) - sender <- receivedFrame.Payload.Buffer[1:] + if receivedFrame.Payload.Length > 0 { + sender <- receivedFrame.Payload.Buffer[1:] + } case closeFunc := <- closer: fmt.Printf("[default] client with protocol '%s' exited\n", client.Protocol) closeFunc()