mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
cleanup(DataResolver): stats can't be falsy (#3651)
This commit is contained in:
committed by
SpaceEEC
parent
6af0da1043
commit
d2ef02906c
@@ -96,7 +96,7 @@ class DataResolver {
|
||||
const file = browser ? resource : path.resolve(resource);
|
||||
fs.stat(file, (err, stats) => {
|
||||
if (err) return reject(err);
|
||||
if (!stats || !stats.isFile()) return reject(new DiscordError('FILE_NOT_FOUND', file));
|
||||
if (!stats.isFile()) return reject(new DiscordError('FILE_NOT_FOUND', file));
|
||||
fs.readFile(file, (err2, data) => {
|
||||
if (err2) reject(err2);
|
||||
else resolve(data);
|
||||
|
||||
Reference in New Issue
Block a user