If we have app.error we always have an app.error.details object

This commit is contained in:
Johannes Zellner
2025-07-23 15:40:25 +02:00
parent f03ac0133f
commit 68a8c964ea
6 changed files with 12 additions and 12 deletions

View File

@@ -1320,7 +1320,7 @@ function checkAppState(app, state) {
if (app.installationState === exports.ISTATE_ERROR) {
// allow task to be called again if that was the errored task
if (app.error.details?.installationState === state) return null;
if (app.error.details.installationState === state) return null;
// allow uninstall from any state
if (state !== exports.ISTATE_PENDING_UNINSTALL && state !== exports.ISTATE_PENDING_RESTORE && state !== exports.ISTATE_PENDING_IMPORT) return new BoxError(BoxError.BAD_STATE, 'Not allowed in error state');
@@ -2246,7 +2246,7 @@ async function repair(app, data, auditSource) {
assert.strictEqual(typeof auditSource, 'object');
const appId = app.id;
let errorState = (app.error && app.error.details?.installationState) || exports.ISTATE_PENDING_CONFIGURE;
let errorState = (app.error && app.error.details.installationState) || exports.ISTATE_PENDING_CONFIGURE;
const task = {
args: {},