mirror of
https://github.com/danbulant/discord.js
synced 2026-05-25 04:52:22 +00:00
Fix resolveFile on nonexistent paths (#717)
This commit is contained in:
parent
afc8e5bee0
commit
a2778d4a96
1 changed files with 1 additions and 1 deletions
|
|
@ -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);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue