From 8d02cfbe197051be683d7adea89da75a9837a1d5 Mon Sep 17 00:00:00 2001 From: Borewit Date: Mon, 21 Oct 2019 21:46:57 +0200 Subject: [PATCH] Prevent the next() being caught recursive --- src/middlewares/podcast/getPodcastDurationInSeconds.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/middlewares/podcast/getPodcastDurationInSeconds.js b/src/middlewares/podcast/getPodcastDurationInSeconds.js index 8a8896d..3f2e9cb 100644 --- a/src/middlewares/podcast/getPodcastDurationInSeconds.js +++ b/src/middlewares/podcast/getPodcastDurationInSeconds.js @@ -13,9 +13,8 @@ module.exports = async (_req, res, next) => { const duration = await getDuration(filePath); res.locals.durationInSeconds = Math.ceil(duration); - - next(); } catch (err) { - next(err); + return next(err); } + next(); };