From 41ef66298e5948f43b141e742d34f1d158f85d30 Mon Sep 17 00:00:00 2001 From: Refringe Date: Thu, 28 Mar 2024 00:29:46 -0400 Subject: [PATCH] Skip Processing Deleted Insurance Attachments This check simply skips over rolling for insurance for attachment items that have already been deleted due to their main-parent item being previously rolled for deletion. --- project/src/controllers/InsuranceController.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/project/src/controllers/InsuranceController.ts b/project/src/controllers/InsuranceController.ts index 844acb29..6e903a5c 100644 --- a/project/src/controllers/InsuranceController.ts +++ b/project/src/controllers/InsuranceController.ts @@ -413,6 +413,13 @@ export class InsuranceController { for (const [parentId, attachmentItems] of mainParentToAttachmentsMap) { + // Skip processing if parentId is already marked for deletion, as all attachments for that parent will + // already be marked for deletion as well. + if (toDelete.has(parentId)) + { + continue; + } + // Log the parent item's name. const parentItem = itemsMap.get(parentId); const parentName = this.itemHelper.getItemName(parentItem._tpl);