From bcf62027bc38a171be12c5f1d6475fa4e846dd44 Mon Sep 17 00:00:00 2001 From: Faris Armoush Date: Tue, 8 Jul 2025 11:12:12 +0300 Subject: [PATCH] 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. --- .../data/services/remote_update_space_service.dart | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/pages/space_management_v2/modules/update_space/data/services/remote_update_space_service.dart b/lib/pages/space_management_v2/modules/update_space/data/services/remote_update_space_service.dart index 9f6f65a6..452a7375 100644 --- a/lib/pages/space_management_v2/modules/update_space/data/services/remote_update_space_service.dart +++ b/lib/pages/space_management_v2/modules/update_space/data/services/remote_update_space_service.dart @@ -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'; } }