print_stats: Fix exception when canceling in/as first G-code

Signed-off-by: Dennis Marttinen <twelho@welho.tech>
This commit is contained in:
Dennis Marttinen 2021-11-20 22:25:49 +02:00 committed by KevinOConnor
parent 8b401382f6
commit 83889ac435
1 changed files with 2 additions and 0 deletions

View File

@ -48,6 +48,8 @@ class PrintStats:
def note_cancel(self):
self._note_finish("cancelled")
def _note_finish(self, state, error_message = ""):
if self.print_start_time is None:
return
self.state = state
self.error_message = error_message
eventtime = self.reactor.monotonic()