Skip to content

Commit

Permalink
catch custom modified time exception
Browse files Browse the repository at this point in the history
  • Loading branch information
OllieGamesDev committed Oct 25, 2024
1 parent 92f84a5 commit 903c649
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ List<AppointmentSlim> 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);
Expand All @@ -66,7 +67,14 @@ List<AppointmentSlim> 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();
Expand Down Expand Up @@ -102,7 +110,7 @@ List<AppointmentSlim> 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)
Expand Down

0 comments on commit 903c649

Please sign in to comment.