From 0251197e249cc03b65805ed6805da72bf4573529 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Mon, 20 Apr 2020 11:20:12 +0200 Subject: Factorize rest-table and fix/simplify SQL --- server/helpers/middlewares/video-abuses.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'server/helpers') diff --git a/server/helpers/middlewares/video-abuses.ts b/server/helpers/middlewares/video-abuses.ts index 7553a5eb3..97a5724b6 100644 --- a/server/helpers/middlewares/video-abuses.ts +++ b/server/helpers/middlewares/video-abuses.ts @@ -7,7 +7,7 @@ async function doesVideoAbuseExist (abuseIdArg: number | string, videoUUID: stri let videoAbuse = await VideoAbuseModel.loadByIdAndVideoId(abuseId, null, videoUUID) if (!videoAbuse) { - const userId = res.locals.oauth ? res.locals.oauth.token.User.id : undefined + const userId = res.locals.oauth?.token.User.id const video = await fetchVideo(videoUUID, 'all', userId) if (video) videoAbuse = await VideoAbuseModel.loadByIdAndVideoId(abuseId, video.id) -- cgit v1.2.3