Skip to content

Commit

Permalink
fix: fallback value for readdir
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed May 24, 2021
1 parent 1c73d0a commit ea7d73b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/drivers/utils/node-fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function unlink (path: string) {
}

export function readdir (dir: string): Promise<Dirent[]> {
return fsPromises.readdir(dir, { withFileTypes: true }).catch(ignoreNotfound)
return fsPromises.readdir(dir, { withFileTypes: true }).catch(ignoreNotfound).then(r => r || [])
}

export async function ensuredir (dir: string) {
Expand Down

0 comments on commit ea7d73b

Please sign in to comment.