fix(mmstaged check): changes to prevent crash where lot sent over is not an object
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user