Merge pull request #179 from SyncrowIOT/bugfix/space-device-check

bugfix check array empty
This commit is contained in:
hannathkadher
2024-12-19 12:27:07 +04:00
committed by GitHub

View File

@ -26,9 +26,9 @@ export class SpaceDeviceService {
spaceUuid, spaceUuid,
); );
if (!Array.isArray(space.devices)) { if (space.devices.length === 0) {
throw new HttpException( 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, HttpStatus.BAD_REQUEST,
); );
} }