fix(xo-server-backup-reports): handle log not found (#3430)

This commit is contained in:
badrAZ 2018-09-20 14:34:29 +02:00 committed by Julien Fontanet
parent 5e363761a2
commit b98b618be8

View File

@ -153,6 +153,9 @@ class BackupReportsXoPlugin {
async _backupNgListener (_1, _2, schedule, runJobId) {
const xo = this._xo
const log = await xo.getBackupNgLogs(runJobId)
if (log === undefined) {
throw new Error(`no log found with runId=${JSON.stringify(runJobId)}`)
}
const { reportWhen, mode } = log.data || {}
if (