From 1438ee52a1b4f60cf437405eea0d393455299e30 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Sun, 24 May 2020 18:42:04 -0700 Subject: [PATCH] import: fix crash because encryption is unset --- src/apps.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/apps.js b/src/apps.js index afb86d0a0..08f39d42e 100644 --- a/src/apps.js +++ b/src/apps.js @@ -1542,9 +1542,13 @@ function importApp(app, data, auditSource, callback) { testBackupConfig(function (error) { if (error) return callback(error); - if (backupConfig && 'password' in backupConfig) { - backupConfig.encryption = backups.generateEncryptionKeysSync(backupConfig.password); - delete backupConfig.password; + if (backupConfig) { + if ('password' in backupConfig) { + backupConfig.encryption = backups.generateEncryptionKeysSync(backupConfig.password); + delete backupConfig.password; + } else { + backupConfig.encryption = null; + } } const restoreConfig = { backupId, backupFormat, backupConfig };