diff --git a/src/apps.js b/src/apps.js index 03d192f74..2ebc785a9 100644 --- a/src/apps.js +++ b/src/apps.js @@ -2265,6 +2265,7 @@ async function restore(app, backupId, auditSource) { // for empty or null backupId, use existing manifest to mimic a reinstall const backupInfo = backupId ? await backups.get(backupId) : { manifest: app.manifest }; + if (!backupInfo) throw new BoxError(BoxError.BAD_FIELD, 'No such backup'); const manifest = backupInfo.manifest; if (!manifest) throw new BoxError(BoxError.EXTERNAL_ERROR, 'Could not get restore manifest');