diff --git a/src/apps.js b/src/apps.js index 296a49aff..3c0f84256 100644 --- a/src/apps.js +++ b/src/apps.js @@ -1364,7 +1364,7 @@ function repair(appId, data, auditSource, callback) { get(appId, function (error, app) { if (error) return callback(error); - const errorState = (app.error && app.error.installationState) || exports.ISTATE_PENDING_CONFIGURE; + let errorState = (app.error && app.error.installationState) || exports.ISTATE_PENDING_CONFIGURE; const task = { args: {}, @@ -1385,6 +1385,8 @@ function repair(appId, data, auditSource, callback) { task.values.manifest = data.manifest; task.args.oldManifest = app.manifest; } + } else { + errorState = exports.ISTATE_PENDING_CONFIGURE; } addTask(appId, errorState, task, function (error, result) {