diff --git a/src/angular/components/add-edit.component.ts b/src/angular/components/add-edit.component.ts index 654353c28aa..0e9f2cdbbcf 100644 --- a/src/angular/components/add-edit.component.ts +++ b/src/angular/components/add-edit.component.ts @@ -157,13 +157,13 @@ export class AddEditComponent { return false; } - if (!this.editMode && this.cipher.type === CipherType.Login && this.cipher.login.uris.length === 1 && + if (!this.editMode && this.cipher.type === CipherType.Login && + this.cipher.login.uris != null && this.cipher.login.uris.length === 1 && (this.cipher.login.uris[0].uri == null || this.cipher.login.uris[0].uri === '')) { this.cipher.login.uris = null; } - const cipher = await this.cipherService.encrypt(this.cipher); - + const cipher = await this.encryptCipher(); try { this.formPromise = this.saveCipher(cipher); await this.formPromise; @@ -311,6 +311,10 @@ export class AddEditComponent { return this.cipherService.get(this.cipherId); } + protected encryptCipher() { + return this.cipherService.encrypt(this.cipher); + } + protected saveCipher(cipher: Cipher) { return this.cipherService.saveWithServer(cipher); }