Skip to content

Commit

Permalink
πŸ› fix: place data check inside try block
Browse files Browse the repository at this point in the history
  • Loading branch information
rezk2ll committed Jul 12, 2024
1 parent 308df16 commit 51a899a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/tom-server/src/vault-api/controllers/vault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ export const updateRecoveryWords = (db: TwakeDB): expressAppHandler => {
const userId: string = req.token.content.sub
const { words } = req.body

if (words === undefined || words.length === 0) {
res.status(400).json({ message: 'Missing recovery sentence' })
return
}

try {
if (words === undefined || words.length === 0) {
res.status(400).json({ message: 'Missing recovery sentence' })
return
}

const data = await db.get('recoveryWords' as Collections, ['words'], {
userId
})
Expand Down

0 comments on commit 51a899a

Please sign in to comment.