@@ -740,7 +740,7 @@ def get_queue_status(self, queue_id: str) -> SessionQueueStatus:
740740 counts_result = cast (list [sqlite3 .Row ], cursor .fetchall ())
741741
742742 current_item = self .get_current (queue_id = queue_id )
743- total = sum (row [1 ] for row in counts_result )
743+ total = sum (row [1 ] or 0 for row in counts_result )
744744 counts : dict [str , int ] = {row [0 ]: row [1 ] for row in counts_result }
745745 return SessionQueueStatus (
746746 queue_id = queue_id ,
@@ -769,7 +769,7 @@ def get_batch_status(self, queue_id: str, batch_id: str) -> BatchStatus:
769769 (queue_id , batch_id ),
770770 )
771771 result = cast (list [sqlite3 .Row ], cursor .fetchall ())
772- total = sum (row [1 ] for row in result )
772+ total = sum (row [1 ] or 0 for row in result )
773773 counts : dict [str , int ] = {row [0 ]: row [1 ] for row in result }
774774 origin = result [0 ]["origin" ] if result else None
775775 destination = result [0 ]["destination" ] if result else None
@@ -801,7 +801,7 @@ def get_counts_by_destination(self, queue_id: str, destination: str) -> SessionQ
801801 )
802802 counts_result = cast (list [sqlite3 .Row ], cursor .fetchall ())
803803
804- total = sum (row [1 ] for row in counts_result )
804+ total = sum (row [1 ] or 0 for row in counts_result )
805805 counts : dict [str , int ] = {row [0 ]: row [1 ] for row in counts_result }
806806
807807 return SessionQueueCountsByDestination (
0 commit comments