From 84ed3b03c17f81f4fd9c0a4e627494b02b9fe8e7 Mon Sep 17 00:00:00 2001 From: hannathkadher Date: Thu, 19 Dec 2024 12:24:13 +0400 Subject: [PATCH] bugfix check array empty --- src/space/services/space-device.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/space/services/space-device.service.ts b/src/space/services/space-device.service.ts index b856be0..75746ca 100644 --- a/src/space/services/space-device.service.ts +++ b/src/space/services/space-device.service.ts @@ -26,9 +26,9 @@ export class SpaceDeviceService { spaceUuid, ); - if (!Array.isArray(space.devices)) { + if (space.devices.length === 0) { throw new HttpException( - 'The space does not contain any devices or the devices property is invalid.', + 'The space does not contain any devices.', HttpStatus.BAD_REQUEST, ); }