Skip to content

Commit 1852480

Browse files
committed
! fix a fatal error on getting incomplete data from Arduino
1 parent 8d28139 commit 1852480

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pkg/deej/serial.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ func (sio *SerialIO) handleBytes(logger *zap.SugaredLogger, bytes []byte) {
238238

239239
if len(bytes)%2 != 0 {
240240
logger.Warnw("Wrong number of bytes received", "bytes number", len(bytes))
241+
return
241242
}
242243

243244
for i := 0; i < len(bytes); i += 2 {

0 commit comments

Comments
 (0)