cleanup(DataResolver): stats can't be falsy (#3651)

This commit is contained in:
Gryffon Bellish
2020-01-05 11:45:16 -05:00
committed by SpaceEEC
parent 6af0da1043
commit d2ef02906c

View File

@@ -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);