mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-16 02:36:19 +00:00
bugfix check array empty
This commit is contained in:
@ -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,
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user