From b0beb7efeb52d4327a4d5662e49a8e20bdad2266 Mon Sep 17 00:00:00 2001 From: Cyberes Date: Sat, 23 Sep 2023 18:55:52 -0600 Subject: [PATCH] fix exception --- llm_server/database/database.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llm_server/database/database.py b/llm_server/database/database.py index 327916b..5f00829 100644 --- a/llm_server/database/database.py +++ b/llm_server/database/database.py @@ -143,7 +143,7 @@ def sum_column(table_name, column_name): try: cursor.execute(f"SELECT SUM({column_name}) FROM {table_name}") result = cursor.fetchone() - return result[0] if result[0] else 0 + return result[0] if result else 0 finally: cursor.close()