X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Fmiddlewares%2Fvideo-abuses.ts;h=97a5724b6dd69afd69ad3c57051896ff1af310a9;hb=610d0be13b3d01f653ef269271dd667a57c85ef2;hp=7553a5eb3355e445606ad8bcbc2cc16a76c1494f;hpb=68d19a0ace01cb7a3550da420d27663e2db1b98d;p=github%2FChocobozzz%2FPeerTube.git 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)