fix exception

This commit is contained in:
Cyberes 2023-09-23 18:55:52 -06:00
parent f67ac8175b
commit b0beb7efeb
1 changed files with 1 additions and 1 deletions

View File

@ -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()