From 6492ab66b0202a080f5eab4f9ddd07e460ea2429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 16 Sep 2013 22:28:21 +0200 Subject: [PATCH] Workaround for issue described in #250 --- src/octoprint/util/comm.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index fbc81f29..7d91a985 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -604,8 +604,9 @@ class MachineCom(object): self._currentFile = PrintingSdFileInformation(match.group(1), int(match.group(2))) elif 'File selected' in line: # final answer to M23, at least on Marlin, Repetier and Sprinter: "File selected" - self._callback.mcFileSelected(self._currentFile.getFilename(), self._currentFile.getFilesize(), True) - eventManager().fire("FileSelected", self._currentFile.getFilename()) + if self._currentFile is not None: + self._callback.mcFileSelected(self._currentFile.getFilename(), self._currentFile.getFilesize(), True) + eventManager().fire("FileSelected", self._currentFile.getFilename()) elif 'Writing to file' in line: # anwer to M28, at least on Marlin, Repetier and Sprinter: "Writing to file: %s" self._printSection = "CUSTOM"