fix(backups): handle undefined isVhdDifferencing (#7248)
Introduced by e13d55bfa9
Fixes https://xcp-ng.org/forum/post/68600
This commit is contained in:
committed by
GitHub
parent
c63d38dc0f
commit
54808967f6
@@ -2,6 +2,8 @@ import mapValues from 'lodash/mapValues.js'
|
||||
import { dirname } from 'node:path'
|
||||
|
||||
function formatVmBackup(backup) {
|
||||
const { isVhdDifferencing } = backup
|
||||
|
||||
return {
|
||||
disks:
|
||||
backup.vhds === undefined
|
||||
@@ -25,8 +27,10 @@ function formatVmBackup(backup) {
|
||||
name_description: backup.vm.name_description,
|
||||
name_label: backup.vm.name_label,
|
||||
},
|
||||
differencingVhds: Object.values(backup.isVhdDifferencing).filter(t => t).length,
|
||||
dynamicVhds: Object.values(backup.isVhdDifferencing).filter(t => !t).length,
|
||||
|
||||
// isVhdDifferencing is either undefined or an object
|
||||
differencingVhds: isVhdDifferencing && Object.values(isVhdDifferencing).filter(t => t).length,
|
||||
dynamicVhds: isVhdDifferencing && Object.values(isVhdDifferencing).filter(t => !t).length,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user