add onedrive mtime error

This commit is contained in:
fyears 2024-07-27 15:02:21 +08:00
parent 871e8dc3cf
commit 254231e4bd
2 changed files with 12 additions and 4 deletions

View File

@ -290,8 +290,12 @@ const fromDriveItemToEntity = (x: DriveItem, remoteBaseDir: string): Entity => {
key = `${key}/`; key = `${key}/`;
} }
const mtimeSvr = Date.parse(x?.fileSystemInfo!.lastModifiedDateTime!); const mtimeTry = x?.fileSystemInfo?.lastModifiedDateTime;
const mtimeCli = Date.parse(x?.fileSystemInfo!.lastModifiedDateTime!); if (mtimeTry === undefined || mtimeTry === null) {
throw Error(`onedrive cannot parse mtime: ${JSON.stringify(x, null, 2)}`);
}
const mtimeSvr = Date.parse(mtimeTry);
const mtimeCli = Date.parse(mtimeTry);
return { return {
key: key, key: key,
keyRaw: key, keyRaw: key,

View File

@ -399,8 +399,12 @@ ${constructFromDriveItemToEntityError(x)}`
key = `${key}/`; key = `${key}/`;
} }
const mtimeSvr = Date.parse(x?.fileSystemInfo!.lastModifiedDateTime!); const mtimeTry = x?.fileSystemInfo?.lastModifiedDateTime;
const mtimeCli = Date.parse(x?.fileSystemInfo!.lastModifiedDateTime!); if (mtimeTry === undefined || mtimeTry === null) {
throw Error(`onedrive cannot parse mtime: ${JSON.stringify(x, null, 2)}`);
}
const mtimeSvr = Date.parse(mtimeTry);
const mtimeCli = Date.parse(mtimeTry);
return { return {
key: key, key: key,
keyRaw: key, keyRaw: key,