From c8ce3b1f94d020d7283f6c3bba2a43c2190cd439 Mon Sep 17 00:00:00 2001 From: "atharva.dev" Date: Mon, 27 Oct 2025 20:51:39 +0530 Subject: [PATCH] file already protected handled --- nodes/SecloreProtect/operations/protectWithHotFolder.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nodes/SecloreProtect/operations/protectWithHotFolder.ts b/nodes/SecloreProtect/operations/protectWithHotFolder.ts index 9644cf4..18aa04f 100644 --- a/nodes/SecloreProtect/operations/protectWithHotFolder.ts +++ b/nodes/SecloreProtect/operations/protectWithHotFolder.ts @@ -85,6 +85,11 @@ async function protectFileWithHotFolder( Logger.debug(who + 'File uploaded successfully', { fileStorageId: uploadResult.fileStorageId, fileName, correlationId }); + // check if the file is already protected + if (uploadResult.protected) { + throw new Error('File is already protected'); + } + originalFileStorageId = uploadResult.fileStorageId; // Protect the uploaded file with HotFolder