From b15438a40b0871503877d373849ee5c9840eb870 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 5 May 2025 16:02:38 -0500 Subject: Handle case where job doesn't exist. --- gn_libs/jobs/jobs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gn_libs') 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}") -- cgit v1.2.3