Skip to content

Commit

Permalink
fix: await promises returned from async file helper functions
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderbira committed Oct 1, 2024
1 parent 2b5de79 commit 2d7a154
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/files/updateUpload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ export const updateUpload = async (
getOldPath: () => Promise<string | null | undefined>,
setNewPath: (path: string) => Promise<any>,
): Promise<FormPassBackState> => {
if (isFileNotEmpty(file)) {
const filePath = `${folder}/${randomBytes(16).toString("hex")}.${getFileExtension(file)}`
if (await isFileNotEmpty(file)) {
const filePath = `${folder}/${randomBytes(16).toString("hex")}.${await getFileExtension(file)}`

// Save the new file to the file system
try {
Expand Down

0 comments on commit 2d7a154

Please sign in to comment.