Merge branch 'master' of https://github.com/ajayyy/SponsorBlockServer into stricter-eslint

This commit is contained in:
Michael C
2021-07-18 02:27:48 -04:00
6 changed files with 87 additions and 12 deletions

View File

@@ -62,7 +62,7 @@ export async function setUsername(req: Request, res: Response): Promise<Response
const locked = adminUserIDInput === undefined ? 0 : 1;
let oldUserName = "";
if (row?.userName?.length > 0) {
if (row?.userName !== undefined) {
//already exists, update this row
oldUserName = row.userName;
await db.prepare("run", `UPDATE "userNames" SET "userName" = ?, "locked" = ? WHERE "userID" = ?`, [userName, locked, userID]);