From 1bca1fab3893aa3d8579f9f7f34c1d4f692c0e8d Mon Sep 17 00:00:00 2001 From: gamosoft_cp Date: Thu, 26 Mar 2015 21:46:44 +0000 Subject: [PATCH] Added small fix for retrieval of non-Exchange deleted tasks --- Outlook2013TodoAddIn/AppointmentsControl.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Outlook2013TodoAddIn/AppointmentsControl.cs b/Outlook2013TodoAddIn/AppointmentsControl.cs index 94290d4..249e673 100644 --- a/Outlook2013TodoAddIn/AppointmentsControl.cs +++ b/Outlook2013TodoAddIn/AppointmentsControl.cs @@ -241,7 +241,14 @@ namespace Outlook2013TodoAddIn List tasks = new List(); foreach (object item in todoFolder.Items) { - tasks.Add(new OLTaskItem(item)); + try + { + tasks.Add(new OLTaskItem(item)); + } + catch + { + // Do nothing, probably the task had already been deleted + } } return tasks.Where(t => t.ValidTaskItem).ToList(); // Filter out invalid ones }