Fix the error with the crashing

This commit is contained in:
Luke Berndt
2023-08-08 22:06:46 -04:00
parent a315d44d6c
commit a8bea173a2

View File

@@ -23,7 +23,7 @@ const client = new S3Client({
exports.upload = async function (req, res, next) {
process.nextTick( async () => {
if (!req.file && (path.extname(req.file.originalname)) != '.m4a') {
if (!req.file || (path.extname(req.file.originalname)) != '.m4a') {
console.warn("[" + req.params.shortName + "] Error file name is wrong or file does not exist");
res.status(500);
res.send("Error, invalid filename:\n");