1
0
mirror of https://github.com/Kopano-dev/kopano-ol-extension.git synced 2023-10-10 13:37:40 +02:00

Added extra null checks for sync data and sharing public folder

This commit is contained in:
Patrick Simpson 2017-10-18 16:20:24 +03:00
parent 57244e8be1
commit 89cb450bb2
2 changed files with 23 additions and 17 deletions

View File

@ -356,27 +356,30 @@ namespace Acacia.Features.SyncState
HashSet<string> syncingNow = new HashSet<string>(); HashSet<string> syncingNow = new HashSet<string>();
// Check all syncing data // Check all syncing data
foreach (KeyValuePair<string, DeviceDetails.ContentData> contentEntry in details.Content) if (details.Content != null)
{ {
DeviceDetails.ContentData content = contentEntry.Value; foreach (KeyValuePair<string, DeviceDetails.ContentData> contentEntry in details.Content)
content.Key = contentEntry.Key;
if (content.IsSyncing)
{ {
// If the current session is not syncing, this is a restart. Clear stat DeviceDetails.ContentData content = contentEntry.Value;
if (!IsSyncing) content.Key = contentEntry.Key;
if (content.IsSyncing)
{ {
_syncContent.Clear(); // If the current session is not syncing, this is a restart. Clear stat
debug.AppendLine("Starting new SyncSession"); if (!IsSyncing)
{
_syncContent.Clear();
debug.AppendLine("Starting new SyncSession");
}
// Add to the syncing content
IsSyncing = true;
_syncContent[content.Key] = content;
syncingNow.Add(content.Key);
debug.AppendLine(string.Format("\tFolder: {0} \tSync: {1} \tStatus: {2} / {3}",
content.Key, content.IsSyncing, content.Sync.done, content.Sync.total));
} }
// Add to the syncing content
IsSyncing = true;
_syncContent[content.Key] = content;
syncingNow.Add(content.Key);
debug.AppendLine(string.Format("\tFolder: {0} \tSync: {1} \tStatus: {2} / {3}",
content.Key, content.IsSyncing, content.Sync.done, content.Sync.total));
} }
} }

View File

@ -81,6 +81,9 @@ namespace Acacia.ZPush
if (result != null && result != contact) if (result != null && result != contact)
result.Dispose(); result.Dispose();
if (contact == null)
return null;
return new ContactStringReplacer(contact); return new ContactStringReplacer(contact);
} }