mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-17 03:05:13 +00:00
Merge pull request #179 from SyncrowIOT/bugfix/space-device-check
bugfix check array empty
This commit is contained in:
@ -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,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user