diff --git a/apps/web/src/app/admin-console/organizations/collections/vault.component.ts b/apps/web/src/app/admin-console/organizations/collections/vault.component.ts index 073d73f6a50..311b3379d05 100644 --- a/apps/web/src/app/admin-console/organizations/collections/vault.component.ts +++ b/apps/web/src/app/admin-console/organizations/collections/vault.component.ts @@ -962,10 +962,10 @@ export class VaultComponent implements OnInit, OnDestroy { await this.editCipher(cipher, true); } - restore = async (c: CipherViewLike): Promise => { + restore = async (c: CipherViewLike) => { const organization = await firstValueFrom(this.organization$); if (!CipherViewLikeUtils.isDeleted(c)) { - return false; + return; } if ( @@ -974,11 +974,11 @@ export class VaultComponent implements OnInit, OnDestroy { !organization.allowAdminAccessToAllCollectionItems ) { this.showMissingPermissionsError(); - return false; + return; } if (!(await this.repromptCipher([c]))) { - return false; + return; } // Allow restore of an Unassigned Item @@ -996,10 +996,10 @@ export class VaultComponent implements OnInit, OnDestroy { message: this.i18nService.t("restoredItem"), }); this.refresh(); - return true; + return; } catch (e) { this.logService.error(e); - return false; + return; } }; diff --git a/apps/web/src/app/vault/components/vault-item-dialog/vault-item-dialog.component.ts b/apps/web/src/app/vault/components/vault-item-dialog/vault-item-dialog.component.ts index 4a24bbcf3fd..b974b9984bb 100644 --- a/apps/web/src/app/vault/components/vault-item-dialog/vault-item-dialog.component.ts +++ b/apps/web/src/app/vault/components/vault-item-dialog/vault-item-dialog.component.ts @@ -100,7 +100,7 @@ export interface VaultItemDialogParams { /** * Function to restore a cipher from the trash. */ - restore?: (c: CipherViewLike) => Promise; + restore?: (c: CipherViewLike) => Promise; } export const VaultItemDialogResult = { diff --git a/apps/web/src/app/vault/individual-vault/vault.component.ts b/apps/web/src/app/vault/individual-vault/vault.component.ts index af79ea4786f..6fbc47a0f85 100644 --- a/apps/web/src/app/vault/individual-vault/vault.component.ts +++ b/apps/web/src/app/vault/individual-vault/vault.component.ts @@ -467,7 +467,7 @@ export class VaultComponent implements OnInit, OnDestr collections, filter.collectionId, ); - searchableCollectionNodes = selectedCollection.children; + searchableCollectionNodes = selectedCollection?.children; } if (await this.searchService.isSearchable(activeUserId, searchText)) { @@ -606,7 +606,7 @@ export class VaultComponent implements OnInit, OnDestr this.collections = collections; this.selectedCollection = selectedCollection; - this.canCreateCollections = allOrganizations.some( + this.canCreateCollections = allOrganizations?.some( (o) => o.canCreateNewCollections && !o.isProviderUser, ); @@ -876,7 +876,7 @@ export class VaultComponent implements OnInit, OnDestr * @returns */ async editCipherAttachments(cipher: C) { - if (cipher.reprompt !== 0 && !(await this.passwordRepromptService.showPasswordPrompt())) { + if (cipher?.reprompt !== 0 && !(await this.passwordRepromptService.showPasswordPrompt())) { await this.go({ cipherId: null, itemId: null }); return; } @@ -1256,16 +1256,16 @@ export class VaultComponent implements OnInit, OnDestr restore = async (c: CipherViewLike) => { let toastMessage; if (!CipherViewLikeUtils.isDeleted(c)) { - return false; + return; } if (!c.edit) { this.showMissingPermissionsError(); - return false; + return; } if (!(await this.repromptCipher([c]))) { - return false; + return; } if (CipherViewLikeUtils.isArchived(c)) { @@ -1284,9 +1284,9 @@ export class VaultComponent implements OnInit, OnDestr this.refresh(); } catch (e) { this.logService.error(e); - return false; + return; } - return true; + return; }; async bulkRestore(ciphers: C[]) { @@ -1585,7 +1585,7 @@ export class VaultComponent implements OnInit, OnDestr */ private async getPasswordFromCipherViewLike(cipher: C): Promise { if (!CipherViewLikeUtils.isCipherListView(cipher)) { - return Promise.resolve(cipher.login.password); + return Promise.resolve(cipher?.login?.password); } const activeUserId = await firstValueFrom(this.accountService.activeAccount$.pipe(getUserId));