restore: fix crash with invalid backup id
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user