From 590bff696b5c6742dc8981992706cd8d8a265429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 18 Mar 2015 11:32:55 +0100 Subject: [PATCH] Also allow plugins to extend gcode scripts which are empty --- src/octoprint/util/comm.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index 7814561e..4a2ee588 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -432,15 +432,15 @@ class MachineCom(object): template = settings().loadScript("gcode", scriptName, context=context) if template is None: - return None - - scriptLines = filter( - lambda x: x is not None and x.strip() != "", - map( - lambda x: process_gcode_line(x, offsets=self._tempOffsets, current_tool=self._currentTool), - template.split("\n") + scriptLines = [] + else: + scriptLines = filter( + lambda x: x is not None and x.strip() != "", + map( + lambda x: process_gcode_line(x, offsets=self._tempOffsets, current_tool=self._currentTool), + template.split("\n") + ) ) - ) for hook in self._gcodescript_hooks: try: