mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 14:13:34 +01:00
Minify: Treat ENOTDIR
like ENOENT
when statting a file
This avoids an exception when require-kernel requests a path like `existing-file.js/index.js`.
This commit is contained in:
parent
aaacbd3a7a
commit
e8df643d75
1 changed files with 1 additions and 1 deletions
|
@ -247,7 +247,7 @@ const statFile = async (filename, dirStatLimit) => {
|
|||
try {
|
||||
stats = await fs.stat(path.resolve(ROOT_DIR, filename));
|
||||
} catch (err) {
|
||||
if (err.code === 'ENOENT') {
|
||||
if (['ENOENT', 'ENOTDIR'].includes(err.code)) {
|
||||
// Stat the directory instead.
|
||||
const [date] = await statFile(path.dirname(filename), dirStatLimit - 1);
|
||||
return [date, false];
|
||||
|
|
Loading…
Reference in a new issue