Skip to content

Commit

Permalink
adding undefined check to isDirectory call
Browse files Browse the repository at this point in the history
  • Loading branch information
pellicceama committed Nov 1, 2022
1 parent 66314eb commit aa8f289
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/utils/filesystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ export async function getNestedFilesDirs(dir: string): Promise<string[]> {

export async function getDirectories(dir: string): Promise<string[]> {
try {

if(await isDirectory(dir)) {
if(dir && await isDirectory(dir)) {
const searchResults =
await Promise.all(
(await readdir (dir))
Expand Down

0 comments on commit aa8f289

Please sign in to comment.