From 77ce399f4f17b2fe8b8881e946aa803cea318759 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Balzarotti?= Date: Thu, 30 Mar 2023 16:10:15 +0200 Subject: [PATCH] prevent crash on stop --- phasectrl.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/phasectrl.py b/phasectrl.py index a0cf219..1da5973 100644 --- a/phasectrl.py +++ b/phasectrl.py @@ -146,7 +146,9 @@ class State(): self.postload() def stop(self): - self.current_phase().exit(self.env) + phase = self.current_phase() + if phase is not None: + phase.exit(self.env) self.done(message='(concat "Recipe " (recipe-name) " stopped manually")') def loadByName(self, recipe):