diff options
author | Frederick Muriuki Muriithi | 2025-05-05 16:02:38 -0500 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2025-05-05 16:02:38 -0500 |
commit | b15438a40b0871503877d373849ee5c9840eb870 (patch) | |
tree | 297915ee91cce07061553201e06b88d279e0427e | |
parent | 69c021d2f7759c61be4dd838968ab47661be88cd (diff) | |
download | gn-libs-b15438a40b0871503877d373849ee5c9840eb870.tar.gz |
Handle case where job doesn't exist.
-rw-r--r-- | gn_libs/jobs/jobs.py | 2 |
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}") |