mirror of
https://github.com/purocean/yn.git
synced 2026-09-24 15:46:02 +08:00
fix: handle errors in file stat retrieval to prevent crashes
This commit is contained in:
@@ -296,7 +296,14 @@ async function travels (
|
||||
|
||||
await Promise.all(list.map(async name => {
|
||||
const p = path.join(location, name)
|
||||
const stat = await fs.stat(p)
|
||||
const stat = await fs.stat(p).catch(e => {
|
||||
console.error('travels', p, e)
|
||||
return null
|
||||
})
|
||||
|
||||
if (!stat) {
|
||||
return
|
||||
}
|
||||
|
||||
if (stat.isFile()) {
|
||||
if (excludeRegex.test(name)) {
|
||||
|
||||
Reference in New Issue
Block a user