1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 00:03:56 +00:00

Defend map Calls

This commit is contained in:
Justin Baur
2024-05-23 12:28:44 -04:00
parent 0e60a3a92a
commit 0c0fe31d40
2 changed files with 2 additions and 2 deletions

View File

@@ -33,7 +33,7 @@ const DECRYPTED_COLLECTION_DATA_KEY = DeriveDefinition.from<
CollectionView[],
{ collectionService: CollectionService }
>(ENCRYPTED_COLLECTION_DATA_KEY, {
deserializer: (obj) => obj.map((collection) => CollectionView.fromJSON(collection)),
deserializer: (obj) => obj?.map((collection) => CollectionView.fromJSON(collection)),
derive: async (collections: Record<CollectionId, CollectionData>, { collectionService }) => {
const data: Collection[] = [];
for (const id in collections ?? {}) {

View File

@@ -16,7 +16,7 @@ export const FOLDER_DECRYPTED_FOLDERS = DeriveDefinition.from<
FolderView[],
{ folderService: FolderService; cryptoService: CryptoService }
>(FOLDER_ENCRYPTED_FOLDERS, {
deserializer: (obj) => obj.map((f) => FolderView.fromJSON(f)),
deserializer: (obj) => obj?.map((f) => FolderView.fromJSON(f)),
derive: async (from, { folderService, cryptoService }) => {
const folders = Object.values(from || {}).map((f) => new Folder(f));