Added small fix for retrieval of non-Exchange deleted tasks

This commit is contained in:
gamosoft_cp 2015-03-26 21:46:44 +00:00
parent 14def3a3a2
commit 1bca1fab38

View File

@ -241,7 +241,14 @@ namespace Outlook2013TodoAddIn
List<OLTaskItem> tasks = new List<OLTaskItem>(); List<OLTaskItem> tasks = new List<OLTaskItem>();
foreach (object item in todoFolder.Items) 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 return tasks.Where(t => t.ValidTaskItem).ToList(); // Filter out invalid ones
} }