From cfaa235ff3bdefbc383dc6fa052f46dfc2d77478 Mon Sep 17 00:00:00 2001 From: Sergej Hoffmann <97111299+SevenWaysDP@users.noreply.github.com> Date: Fri, 6 Oct 2023 09:59:56 +0200 Subject: [PATCH] BC-5461 - Fixed check for undefined props by file permissions (#3324) Co-authored-by: Cedric Evers <12080057+CeEv@users.noreply.github.com> --- controllers/files.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/files.js b/controllers/files.js index 218cedec46..1374a3e920 100644 --- a/controllers/files.js +++ b/controllers/files.js @@ -224,7 +224,7 @@ const FileGetter = (req, res, next) => { } const files = result.filter((f) => f).map((file) => { - if (file.permissions[0].refId === userId) { + if (file.permissions[0]?.refId === userId) { Object.assign(file, { userIsOwner: true, });