mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 00:03:56 +00:00
Defend map Calls
This commit is contained in:
@@ -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 ?? {}) {
|
||||
|
||||
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user