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

@ -240,9 +240,16 @@ 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)
{
try
{ {
tasks.Add(new OLTaskItem(item)); 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
} }