diff --git a/src/apps.js b/src/apps.js index 03271a8bc..b47131a0b 100644 --- a/src/apps.js +++ b/src/apps.js @@ -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;