From 520f20d428b09acdea40edda1e64224e99e65021 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 26 Apr 2019 21:00:17 -0400 Subject: [PATCH] fixes for password wallet --- src/importers/passwordWalletTxtImporter.ts | 23 +++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/importers/passwordWalletTxtImporter.ts b/src/importers/passwordWalletTxtImporter.ts index 0e691bc610..c98459f354 100644 --- a/src/importers/passwordWalletTxtImporter.ts +++ b/src/importers/passwordWalletTxtImporter.ts @@ -13,17 +13,26 @@ export class PasswordWalletTxtImporter extends BaseImporter implements Importer } results.forEach((value) => { - if (value.length < 6) { + if (value.length < 1) { return; } - - this.processFolder(result, value[5]); + if (value.length > 5) { + this.processFolder(result, value[5]); + } const cipher = this.initLoginCipher(); cipher.name = this.getValueOrDefault(value[0], '--'); - cipher.notes = this.getValueOrDefault(value[4]); - cipher.login.username = this.getValueOrDefault(value[2]); - cipher.login.password = this.getValueOrDefault(value[3]); - cipher.login.uris = this.makeUriArray(value[1]); + if (value.length > 4) { + cipher.notes = this.getValueOrDefault(value[4], '').split('¬').join('\n'); + } + if (value.length > 2) { + cipher.login.username = this.getValueOrDefault(value[2]); + } + if (value.length > 3) { + cipher.login.password = this.getValueOrDefault(value[3]); + } + if (value.length > 1) { + cipher.login.uris = this.makeUriArray(value[1]); + } this.cleanupCipher(cipher); result.ciphers.push(cipher); });