mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
Fix resolveFile on nonexistent paths (#717)
This commit is contained in:
@@ -229,7 +229,7 @@ class ClientDataResolver {
|
||||
const file = path.resolve(resource);
|
||||
fs.stat(file, (err, stats) => {
|
||||
if (err) reject(err);
|
||||
if (!stats.isFile()) throw new Error(`The file could not be found: ${file}`);
|
||||
if (!stats || !stats.isFile()) throw new Error(`The file could not be found: ${file}`);
|
||||
fs.readFile(file, (err2, data) => {
|
||||
if (err2) reject(err2); else resolve(data);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user