From 21034b381cd65192a2f32b505138f4c27c9fafdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 16 Feb 2016 10:04:06 +0100 Subject: [PATCH] Cancelling a print that is not ongoing doesn't make sense --- 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 9fddd6b5..6bea89a9 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -665,6 +665,10 @@ class MachineCom(object): if not self.isOperational() or self.isStreaming(): return + if not self.isBusy() or self._currentFile is None: + # we aren't even printing, nothing to cancel... + return + self._changeState(self.STATE_OPERATIONAL) if self.isSdFileSelected():