From 19ba3b1f99550ff5364001bc0cacd7572307152e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 10 Nov 2014 16:39:20 +0100 Subject: [PATCH] command might be None after hook processors are through with it --- src/octoprint/comm/protocol/reprap/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/octoprint/comm/protocol/reprap/__init__.py b/src/octoprint/comm/protocol/reprap/__init__.py index 0d7cf5c7f..cf5721960 100644 --- a/src/octoprint/comm/protocol/reprap/__init__.py +++ b/src/octoprint/comm/protocol/reprap/__init__.py @@ -884,7 +884,7 @@ class RepRapProtocol(Protocol): for hook in self._gcode_hooks[phase]: command, with_line_number = hook(self, command, with_line_number) - if phase in self._preprocessors and command.command in self._preprocessors[phase]: + if phase in self._preprocessors and command is not None and command.command in self._preprocessors[phase]: command, with_line_number = self._preprocessors[phase][command.command](command, with_line_number) return command, with_line_number