From 7dfa6ae4bd8dd74ac93c7b09be3bbe820bada226 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 13 Aug 2015 13:09:06 +0200 Subject: [PATCH] Never send empty/whitespace only commands --- src/octoprint/util/comm.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index 31f3cb3e..8577092b 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -1598,6 +1598,10 @@ class MachineCom(object): # so no, we are not going to send this, that was a last-minute bail, let's fetch the next item from the queue continue + if command.strip() == "": + self._logger.info("Refusing to send an empty line to the printer") + continue + # now comes the part where we increase line numbers and send stuff - no turning back now command_requiring_checksum = gcode is not None and gcode in self._checksum_requiring_commands command_allowing_checksum = gcode is not None or self._sendChecksumWithUnknownCommands