Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][photos] Fix collections UI type errors

Neeraj Gupta4b988e951e8e
diff --git a/mobile/apps/photos/lib/services/collections_service.dart b/mobile/apps/photos/lib/services/collections_service.dart
index 326048659c..e0c3e776eb 100644
--- a/mobile/apps/photos/lib/services/collections_service.dart
+++ b/mobile/apps/photos/lib/services/collections_service.dart
@@ -472,7 +472,10 @@ class CollectionsService {
allowedRoles.add(CollectionParticipantRole.collaborator);
allowedRoles.add(CollectionParticipantRole.admin);
}
- final int userID = _config.getUserID()!;
+ final int? userID = _config.getUserID();
+ if (userID == null) {
+ return <Collection>[];
+ }
return _collectionIDToCollections.values
.where(
(c) =>
@@ -1535,7 +1538,8 @@ class CollectionsService {
Map<String, dynamic> collectionData,
Uint8List collectionKey,
) async {
- collection.setName(_decryptCollectionNameWithKey(collection, collectionKey));
+ collection
+ .setName(_decryptCollectionNameWithKey(collection, collectionKey));
if (collectionData['pubMagicMetadata'] != null) {
final utfEncodedMmd = await CryptoUtil.decryptChaCha(
CryptoUtil.base642bin(collectionData['pubMagicMetadata']['data']),
@@ -1546,8 +1550,7 @@ class CollectionsService {
);
collection.mMdPubEncodedJson = utf8.decode(utfEncodedMmd);
collection.mMbPubVersion = collectionData['pubMagicMetadata']['version'];
- collection.pubMagicMetadata =
- CollectionPubMagicMetadata.fromEncodedJson(
+ collection.pubMagicMetadata = CollectionPubMagicMetadata.fromEncodedJson(
collection.mMdPubEncodedJson ?? '{}',
);
}