backuptask: fix crash when (old) stats object has no copy field
This commit is contained in:
+1
-1
@@ -319,7 +319,7 @@ async function backupBox(backupSite, appBackupsMap, tag, options, progressCallba
|
||||
if (!error) {
|
||||
stats.copy = { startTime: copyStartTime, duration: Date.now() - copyStartTime };
|
||||
// stats object might be null for stopped/errored apps from old versions
|
||||
stats.aggregatedCopy = Array.from(appBackupsMap.values()).filter(s => !!s).reduce((acc, cur) => ({
|
||||
stats.aggregatedCopy = Array.from(appBackupsMap.values()).filter(s => !!s?.copy).reduce((acc, cur) => ({
|
||||
startTime: Math.min(acc.startTime, cur.copy.startTime),
|
||||
duration: acc.duration + cur.copy.duration,
|
||||
}), stats.copy);
|
||||
|
||||
Reference in New Issue
Block a user