From dd6895fac26d051e5f91094c4ca97fe59c924774 Mon Sep 17 00:00:00 2001 From: Blake Matthes Date: Sun, 13 Apr 2025 08:28:30 -0500 Subject: [PATCH] fix(lots): if no sql it crashs due to lots returning a non error --- server/services/ocp/utils/checkAssignments.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/services/ocp/utils/checkAssignments.ts b/server/services/ocp/utils/checkAssignments.ts index e84f5de..be420be 100644 --- a/server/services/ocp/utils/checkAssignments.ts +++ b/server/services/ocp/utils/checkAssignments.ts @@ -29,11 +29,11 @@ export const assignedPrinters = async () => { } const printers: any = print.data ?? []; - const lots: any = l.data ?? []; + const lots: any = l.data.length === 0 ? [] : l.data; for (let i = 0; i < printers.length; i++) { // is the printer assinged in alplalabel online? - const assigned = lots.filter( + const assigned = lots?.filter( (p: any) => p.printerID === parseInt(printers[i].humanReadableId) );