mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
Defend map Calls
This commit is contained in:
@@ -33,7 +33,7 @@ const DECRYPTED_COLLECTION_DATA_KEY = DeriveDefinition.from<
|
|||||||
CollectionView[],
|
CollectionView[],
|
||||||
{ collectionService: CollectionService }
|
{ collectionService: CollectionService }
|
||||||
>(ENCRYPTED_COLLECTION_DATA_KEY, {
|
>(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 }) => {
|
derive: async (collections: Record<CollectionId, CollectionData>, { collectionService }) => {
|
||||||
const data: Collection[] = [];
|
const data: Collection[] = [];
|
||||||
for (const id in collections ?? {}) {
|
for (const id in collections ?? {}) {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export const FOLDER_DECRYPTED_FOLDERS = DeriveDefinition.from<
|
|||||||
FolderView[],
|
FolderView[],
|
||||||
{ folderService: FolderService; cryptoService: CryptoService }
|
{ folderService: FolderService; cryptoService: CryptoService }
|
||||||
>(FOLDER_ENCRYPTED_FOLDERS, {
|
>(FOLDER_ENCRYPTED_FOLDERS, {
|
||||||
deserializer: (obj) => obj.map((f) => FolderView.fromJSON(f)),
|
deserializer: (obj) => obj?.map((f) => FolderView.fromJSON(f)),
|
||||||
derive: async (from, { folderService, cryptoService }) => {
|
derive: async (from, { folderService, cryptoService }) => {
|
||||||
const folders = Object.values(from || {}).map((f) => new Folder(f));
|
const folders = Object.values(from || {}).map((f) => new Folder(f));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user