diff --git a/src/features/device-logs/lib/supervisor.ts b/src/features/device-logs/lib/supervisor.ts index 5c6a06c45..7e53f969d 100644 --- a/src/features/device-logs/lib/supervisor.ts +++ b/src/features/device-logs/lib/supervisor.ts @@ -9,7 +9,7 @@ const MAX_LOGS_PER_BATCH = 10; export class Supervisor { public convertLogs(logs: SupervisorLog[]): DeviceLog[] { - if (logs.length > MAX_LOGS_PER_BATCH) { + if (Array.isArray(logs) && logs.length > MAX_LOGS_PER_BATCH) { throw new errors.BadRequestError( `Batches cannot include more than ${MAX_LOGS_PER_BATCH} logs`, );