From 903c6493fad79e5f7db6d3d414283b82cf4eeca8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=83=D1=80=20=D0=90=D1=80=D1=83=D1=82?= =?UTF-8?q?=D1=8E=D0=BD=D1=8F=D0=BD?= <145011246+OllieGamesDev@users.noreply.github.com> Date: Fri, 25 Oct 2024 17:26:54 +0300 Subject: [PATCH] catch custom modified time exception --- .../Common/QueryOutlookFolderByGetTableStrategy.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CalDavSynchronizer/Implementation/Common/QueryOutlookFolderByGetTableStrategy.cs b/CalDavSynchronizer/Implementation/Common/QueryOutlookFolderByGetTableStrategy.cs index 79d4183b..e4d13e41 100644 --- a/CalDavSynchronizer/Implementation/Common/QueryOutlookFolderByGetTableStrategy.cs +++ b/CalDavSynchronizer/Implementation/Common/QueryOutlookFolderByGetTableStrategy.cs @@ -57,6 +57,7 @@ List IQueryOutlookAppointmentItemFolderStrategy.QueryAppointmen using (var tableWrapper = GenericComObjectWrapper.Create( calendarFolder.GetTable(filter))) { + bool useCustomModificationTime = true; var table = tableWrapper.Inner; table.Columns.RemoveAll(); table.Columns.Add(PR_GLOBAL_OBJECT_ID); @@ -66,7 +67,14 @@ List IQueryOutlookAppointmentItemFolderStrategy.QueryAppointmen table.Columns.Add(SubjectColumnId); table.Columns.Add(StartColumnId); table.Columns.Add(EndColumnId); - table.Columns.Add(UserModificationTimeColumnId); + try + { + table.Columns.Add(UserModificationTimeColumnId); + } + catch + { + useCustomModificationTime = false; + } while (!table.EndOfTable) { var row = table.GetNextRow(); @@ -102,7 +110,7 @@ List IQueryOutlookAppointmentItemFolderStrategy.QueryAppointmen var appointmentId = new AppointmentId(entryId, globalAppointmentId); var lastModificationTimeObject = row[LastModificationTimeColumnId]; - var userModificationTimeObject = row[UserModificationTimeColumnId]; + var userModificationTimeObject = useCustomModificationTime ? row[UserModificationTimeColumnId] : null; DateTime lastModificationTime; DateTime userModificationTime; if (lastModificationTimeObject != null)