bugfix check array empty

This commit is contained in:
hannathkadher
2024-12-19 12:24:13 +04:00
parent d8d783e1dc
commit 84ed3b03c1

View File

@ -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,
);
}