Update server dependencies
[oweals/peertube.git] / server / middlewares / validators / videos / video-imports.ts
index e3d900a9ea7130e09c8148504cf656115ecd310b..d69aff1180322252233cd2720eb98430a665c2e1 100644 (file)
@@ -38,7 +38,7 @@ const videoImportAddValidator = getCommonVideoEditAttributes().concat([
     logger.debug('Checking videoImportAddValidator parameters', { parameters: req.body })
 
     const user = res.locals.oauth.token.User
-    const torrentFile = req.files && req.files['torrentfile'] ? req.files['torrentfile'][0] : undefined
+    const torrentFile = req.files?.['torrentfile'] ? req.files['torrentfile'][0] : undefined
 
     if (areValidationErrors(req, res)) return cleanUpReqFiles(req)