From c9d6a3d333ee260094764cfb4c1c8c1e7aebdfa2 Mon Sep 17 00:00:00 2001 From: Lautaro Dragan Date: Tue, 24 Sep 2019 17:25:36 -0300 Subject: [PATCH] fix: encryption migration script (#1003) --- src/scripts/migrate-encryption.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scripts/migrate-encryption.ts b/src/scripts/migrate-encryption.ts index 71d4cbe5a..bed3ec70e 100644 --- a/src/scripts/migrate-encryption.ts +++ b/src/scripts/migrate-encryption.ts @@ -66,8 +66,8 @@ async function migratePrivateKeys() { const decryptedAccounts = await Promise.all(accounts.map(async account => { try { const privateKey = await decryptBackwardsCompatible(account.privateKey) - const apiTokens = await decryptApiTokens(account.apiTokens) - const testApiTokens = await decryptApiTokens(account.testApiTokens) + const apiTokens = await decryptApiTokens(account.apiTokens || []) + const testApiTokens = await decryptApiTokens(account.testApiTokens || []) return right({ _id: account._id, email: account.email,