From 45570e93974fd8902a724c24f5a10aea747350e0 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 5 Aug 2021 14:24:03 +0200 Subject: [PATCH] Fix upload without files --- server/middlewares/validators/videos/videos.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/middlewares/validators/videos/videos.ts b/server/middlewares/validators/videos/videos.ts index 374a59c50..13187f398 100644 --- a/server/middlewares/validators/videos/videos.ts +++ b/server/middlewares/validators/videos/videos.ts @@ -188,7 +188,7 @@ const videosAddResumableInitValidator = getCommonVideoEditAttributes().concat([ // multer required unsetting the Content-Type, now we can set it for node-uploadx req.headers['content-type'] = 'application/json; charset=utf-8' // place previewfile in metadata so that uploadx saves it in .META - if (req.files['previewfile']) req.body.previewfile = req.files['previewfile'] + if (req.files?.['previewfile']) req.body.previewfile = req.files['previewfile'] return next() } -- 2.41.0