Fix crash with unencrypted backups
This commit is contained in:
+3
-7
@@ -401,13 +401,9 @@ function setBackupConfig(backupConfig, callback) {
|
||||
backups.testConfig(backupConfig, function (error) {
|
||||
if (error) return callback(error);
|
||||
|
||||
if ('password' in backupConfig) { // user changed password
|
||||
if (backupConfig.password) {
|
||||
backupConfig.encryption = backups.generateEncryptionKeysSync(backupConfig.password);
|
||||
delete backupConfig.password;
|
||||
} else {
|
||||
backupConfig.encryption = null;
|
||||
}
|
||||
if ('password' in backupConfig) { // user set password
|
||||
backupConfig.encryption = backups.generateEncryptionKeysSync(backupConfig.password);
|
||||
delete backupConfig.password;
|
||||
}
|
||||
|
||||
backups.cleanupCacheFilesSync();
|
||||
|
||||
Reference in New Issue
Block a user