Fix crash
ReferenceError: Cannot access 'backups' before initialization
This commit is contained in:
@@ -2477,11 +2477,11 @@ async function restoreInstalledApps(options, auditSource) {
|
||||
apps = apps.filter(app => app.installationState !== exports.ISTATE_PENDING_RESTORE); // safeguard against tasks being created non-stop if we crash on startup
|
||||
|
||||
for (const app of apps) {
|
||||
const [error, backups] = await safe(backups.getByIdentifierAndStatePaged(app.id, backups.BACKUP_STATE_NORMAL, 1, 1));
|
||||
const [error, result] = await safe(backups.getByIdentifierAndStatePaged(app.id, backups.BACKUP_STATE_NORMAL, 1, 1));
|
||||
let installationState, restoreConfig, oldManifest;
|
||||
if (!error && backups.length) {
|
||||
if (!error && result.length) {
|
||||
installationState = exports.ISTATE_PENDING_RESTORE;
|
||||
restoreConfig = { remotePath: backups[0].remotePath, backupFormat: backups[0].format };
|
||||
restoreConfig = { remotePath: result[0].remotePath, backupFormat: result[0].format };
|
||||
oldManifest = app.manifest;
|
||||
} else {
|
||||
installationState = exports.ISTATE_PENDING_INSTALL;
|
||||
|
||||
Reference in New Issue
Block a user