Skip to content

Commit cd243a3

Browse files
committed
TASK: Possible bugfix for None type object
1 parent 7b06b9d commit cd243a3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

database/db_wrapper.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ def get_played_games(self, user_id: int) -> int:
7373
self.cursor.execute("SELECT gamesPlayed FROM users WHERE userID=?;", [str(user_id)])
7474

7575
result = self.cursor.fetchone()
76+
77+
if not result:
78+
return 0
79+
7680
if len(result) > 0:
7781
return int(result[0])
7882
else:

0 commit comments

Comments
 (0)