diff options
| author | Munyoki Kilyungi | 2025-07-03 11:06:44 +0300 |
|---|---|---|
| committer | BonfaceKilz | 2025-07-07 07:58:31 +0300 |
| commit | 593dfd97a0efe3f3056b9f3b981301512fad0b20 (patch) | |
| tree | 574c9842b1870479a178e36916ba84b686bc2f20 /gn3/db/case_attributes.py | |
| parent | 0c39fb06bae2b8e59f5e99c9af95b505c73ca037 (diff) | |
| download | genenetwork3-593dfd97a0efe3f3056b9f3b981301512fad0b20.tar.gz | |
Add null check for cursor.fetchone() in apply_change function.
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
Diffstat (limited to 'gn3/db/case_attributes.py')
| -rw-r--r-- | gn3/db/case_attributes.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gn3/db/case_attributes.py b/gn3/db/case_attributes.py index 46c4480..421b012 100644 --- a/gn3/db/case_attributes.py +++ b/gn3/db/case_attributes.py @@ -316,7 +316,10 @@ def apply_change(cursor, change_type: EditStatus, change_id: int, directory: Pat "id = %s", (change_id,) ) - json_diff_data, _ = cursor.fetchone() + result = cursor.fetchone() + if result is None: + return False + json_diff_data = result[0] json_diff_data = json.loads(json_diff_data) inbredset_id = json_diff_data.get("inbredset_id") modifications = json_diff_data.get( |
