From abc6f56247226fc606a6ef449693175975918311 Mon Sep 17 00:00:00 2001 From: Neeraj Gupta <254676+ua741@users.noreply.github.com> Date: Thu, 13 Mar 2025 17:12:26 +0530 Subject: [PATCH] [mob] Fix: Handle null nonce for shared collections --- mobile/lib/models/collection/collection.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mobile/lib/models/collection/collection.dart b/mobile/lib/models/collection/collection.dart index 4d8e4473e2..1fc9a6e073 100644 --- a/mobile/lib/models/collection/collection.dart +++ b/mobile/lib/models/collection/collection.dart @@ -12,6 +12,7 @@ class Collection { final int id; final User owner; final String encryptedKey; + // keyDecryptionNonce will be empty string for collections shared with the user final String keyDecryptionNonce; String? name; final CollectionType type; @@ -79,7 +80,9 @@ class Collection { id: collection.id, owner: collection.owner, encryptedKey: collection.encryptedKey, - keyDecryptionNonce: collection.keyDecryptionNonce!, + // note: keyDecryptionNonce will be null in case of collections + // shared with the user + keyDecryptionNonce: collection.keyDecryptionNonce ?? '', name: collection.displayName, type: collection.type, sharees: collection.sharees,