From 5f0c3c82b66d70f6f9f3eeb56cc78e90d72dd519 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Wed, 7 Aug 2024 13:00:00 +0200 Subject: [PATCH] #296: fix bug when error occurs before reporter is instantiated --- alphadia/planning.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/alphadia/planning.py b/alphadia/planning.py index 0a02d02e..57481f4a 100644 --- a/alphadia/planning.py +++ b/alphadia/planning.py @@ -346,8 +346,9 @@ def run( raise e finally: - workflow.reporter.log_string(f"Finished workflow for {raw_name}") - workflow.reporter.context.__exit__(None, None, None) + if workflow.reporter: + workflow.reporter.log_string(f"Finished workflow for {raw_name}") + workflow.reporter.context.__exit__(None, None, None) del workflow try: