Fixed silly error in checkusernametaken

This commit is contained in:
Tracker-Friendly 2024-06-25 16:29:40 +01:00
parent d04785d2d3
commit 14deebd553
1 changed files with 2 additions and 2 deletions

View File

@ -147,13 +147,13 @@ func checkUsernameTaken(username string) (int, bool, error) {
err := conn.QueryRow("SELECT id FROM users WHERE lower(username) = ? LIMIT 1", username).Scan(&id)
if err != nil {
if errors.Is(err, sql.ErrNoRows) {
return 0, true, nil
return 0, false, nil
} else {
return 0, true, err
}
}
return id, false, nil
return id, true, nil
}
func init_db() {