Skip to content

Commit

Permalink
fix(explorer): symlink error
Browse files Browse the repository at this point in the history
  • Loading branch information
CyanSalt committed Nov 7, 2024
1 parent 786ec22 commit a63a149
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions addons/explorer/src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,14 @@ export default () => {
const symlink = isSymlink
? path.join(dirent.parentPath, await fs.promises.readlink(fullPath))
: undefined
const stats = symlink
? await fs.promises.stat(symlink)
: dirent
let stats: fs.Stats | fs.Dirent = dirent
if (symlink) {
try {
stats = await fs.promises.stat(symlink)
} catch {
// ignore
}
}
return {
name: dirent.name,
path: fullPath,
Expand Down

0 comments on commit a63a149

Please sign in to comment.