From f09c65312ebaeb302e8c06f40c3c4efacc02c14f Mon Sep 17 00:00:00 2001 From: encetamasb Date: Mon, 31 Jan 2022 16:25:20 +0100 Subject: [PATCH] Fix: job history might be empty --- tsd_moonraker/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsd_moonraker/app.py b/tsd_moonraker/app.py index 11a4ca0..9fdcc8b 100644 --- a/tsd_moonraker/app.py +++ b/tsd_moonraker/app.py @@ -208,7 +208,7 @@ def wait_for_sub_id(event): def _received_last_job(self, event): if 'jobs' in event.data.get('result', {}): - jobs = event.data.get('result', {}).get('jobs', [None]) + jobs = event.data.get('result', {}).get('jobs', [None]) or [None] self.on_event( Event(sender=self.id, name='last_job', data=jobs[0]) )