From 30d2ec0477513a18c516a2a49f0b392dc5e9c679 Mon Sep 17 00:00:00 2001 From: Blake Matthes Date: Mon, 8 Dec 2025 08:34:52 -0600 Subject: [PATCH] fix(materials): if no machine stop the check and fail so it manual needs tried again --- .../services/ocp/controller/materials/mainMaterial.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lstV2/server/services/ocp/controller/materials/mainMaterial.ts b/lstV2/server/services/ocp/controller/materials/mainMaterial.ts index 29a162d..7a5a909 100644 --- a/lstV2/server/services/ocp/controller/materials/mainMaterial.ts +++ b/lstV2/server/services/ocp/controller/materials/mainMaterial.ts @@ -20,6 +20,12 @@ export const isMainMatStaged = async (lot: any) => { const machine = data.data.filter( (m: any) => m.HumanReadableId === lot.machineID, ); + + // just in case we encounter an issue with the machines + if (machine.length === 0) { + createLog("error", "mainMaterial", "ocp", "Invalid machine passed over."); + return false; + } // we have a check on ksc side to ignore the tetra machine for now as its not updating in 2.0 if (!machine[0].StagingMainMaterialMandatory) { createLog(