Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob] Add assertion check

Neeraj Guptab8ad320931e9
diff --git a/mobile/lib/services/collections_service.dart b/mobile/lib/services/collections_service.dart
index 8aca89c202..5761810c68 100644
--- a/mobile/lib/services/collections_service.dart
+++ b/mobile/lib/services/collections_service.dart
@@ -1170,6 +1170,13 @@ class CollectionsService {
_logger.info("nothing to add to the collection");
return;
}
+ final anyFileOwnedByOther =
+ files.any((e) => e.ownerID != null && e.ownerID != _config.getUserID());
+ if (anyFileOwnedByOther) {
+ throw ArgumentError(
+ 'Cannot add files owned by other users, they should be copied',
+ );
+ }
final params = <String, dynamic>{};
params["collectionID"] = collectionID;