aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2025-05-05 16:02:38 -0500
committerFrederick Muriuki Muriithi2025-05-05 16:02:38 -0500
commitb15438a40b0871503877d373849ee5c9840eb870 (patch)
tree297915ee91cce07061553201e06b88d279e0427e
parent69c021d2f7759c61be4dd838968ab47661be88cd (diff)
downloadgn-libs-b15438a40b0871503877d373849ee5c9840eb870.tar.gz
Handle case where job doesn't exist.
-rw-r--r--gn_libs/jobs/jobs.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/gn_libs/jobs/jobs.py b/gn_libs/jobs/jobs.py
index 6989f3e..b705676 100644
--- a/gn_libs/jobs/jobs.py
+++ b/gn_libs/jobs/jobs.py
@@ -48,7 +48,7 @@ def job(conn: DbConnection, job_id: Union[str, uuid.UUID], fulldetails: bool = F
"""Fetch the job details for a job with a particular ID"""
with _cursor(conn) as cursor:
cursor.execute("SELECT * FROM jobs WHERE job_id=?", (str(job_id),))
- _job = dict(cursor.fetchone())
+ _job = dict(cursor.fetchone() or {})
if not bool(_job):
raise JobNotFound(f"Could not find job with ID {job_id}")