Skip to content

Commit 66415fe

Browse files
committed
fix TypeError on unknown user
1 parent 4b3f0d6 commit 66415fe

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

phpbb/auth/sql.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,12 @@ def __call__(self, username_clean):
5555
c = self.conn.cursor()
5656
c.execute(self.sql, [username_clean,])
5757

58-
return dict(zip(USER_ROW_FIELDS, c.fetchone()))
58+
user_row = c.fetchone()
59+
60+
if user_row:
61+
return dict(zip(USER_ROW_FIELDS, user_row))
62+
else:
63+
return None
5964

6065
get_user_row = GetUserRow()
6166
setup = get_user_row.setup

0 commit comments

Comments
 (0)