From fa1e6ad76b9aba76496c1b062dd14f22f597f83b Mon Sep 17 00:00:00 2001 From: Tom Plant Date: Tue, 4 Jun 2024 19:31:55 +1000 Subject: [PATCH] fix: items with missing `lastModifiedBy` Some items have a `lastModifiedDateTime`, but no `lastModifiedBy` --- src/web/open-onedrive-command.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/web/open-onedrive-command.ts b/src/web/open-onedrive-command.ts index 944435d..491fd48 100644 --- a/src/web/open-onedrive-command.ts +++ b/src/web/open-onedrive-command.ts @@ -90,7 +90,7 @@ function pickFolder( children.then((children) => { const items: FolderPickItem[] = children.value.map((item) => { const mtime = new Date(item.lastModifiedDateTime); - const desc = `${item.lastModifiedBy.user.displayName} at ${dateFormat.format(mtime)}`; + const desc = `${item.lastModifiedBy?.user.displayName || "Unknown"} at ${dateFormat.format(mtime)}`; return item.folder ? { item,