diff --git a/server/src/controllers/accounts.controllers.ts b/server/src/controllers/accounts.controllers.ts index 4d8f1651f397c7ab82d51a504161fcfdf9194371..31b3e09c5932ce408256c010d206f8deb153c882 100644 --- a/server/src/controllers/accounts.controllers.ts +++ b/server/src/controllers/accounts.controllers.ts @@ -127,6 +127,10 @@ const updateAccount = async (req: Request, res: Response) => { }, }); + if (checkIfIdExists === null) { + return res.status(404).json({ success: false, error: "accountNotFound" }); + } + //hash given password if (input.password !== undefined) { input.password = await bcrypt.hash(input.password, 10);