fix exception
This commit is contained in:
parent
f67ac8175b
commit
b0beb7efeb
|
@ -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()
|
||||
|
||||
|
|
Reference in New Issue