fix(mmstaged check): changes to prevent crash where lot sent over is not an object

This commit is contained in:
2025-04-24 21:31:42 -05:00
parent 9cea76e01f
commit c5ebe4e2fa

View File

@@ -11,6 +11,16 @@ export const isMainMatStaged = async (lot: any) => {
return isStaged;
}
if (typeof lot !== "object" || lot === null || Array.isArray(lot)) {
createLog(
"info",
"mainMaterial",
"ocp",
`The lot sent over is not an object: ${JSON.stringify(lot)}`
);
return isStaged;
}
const updateQuery = mmQuery.replaceAll("[lotNumber]", lot.lot);
try {