mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
Validate UUIDs in RemoteUpdateSpaceService: Added checks for empty space and community UUIDs before constructing the update URL, improving error handling and robustness in the update space process.
This commit is contained in:
@ -51,6 +51,16 @@ class RemoteUpdateSpaceService implements UpdateSpaceService {
|
||||
throw APIException('Project UUID is not set');
|
||||
}
|
||||
|
||||
return '/projects/$projectUuid/communities/${param.communityUuid}/spaces/${param.space.uuid}';
|
||||
final spaceUuid = param.space.uuid;
|
||||
if (spaceUuid.isEmpty) {
|
||||
throw APIException('Space UUID is not set');
|
||||
}
|
||||
|
||||
final communityUuid = param.communityUuid;
|
||||
if (communityUuid.isEmpty) {
|
||||
throw APIException('Community UUID is not set');
|
||||
}
|
||||
|
||||
return '/projects/$projectUuid/communities/$communityUuid/spaces/$spaceUuid';
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user