diff --git a/lib/plugin.js b/lib/plugin.js index 9969ad2b..59b58951 100644 --- a/lib/plugin.js +++ b/lib/plugin.js @@ -56,7 +56,7 @@ cds.once("served", async function registerPluginHandlers() { } async function validateAttachment(req) { - if(req._path.endsWith("content")) { + if(req._path?.endsWith("content")) { const status = await AttachmentsSrv.getStatus(req.target, req.params.at(-1)); if(status !== 'Clean') { req.reject(403, 'Unable to download the attachment as scan status is not clean.');