diff --git a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SyncState/FeatureSyncState.cs b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SyncState/FeatureSyncState.cs index 1c0921b..4dddaf8 100644 --- a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SyncState/FeatureSyncState.cs +++ b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/SyncState/FeatureSyncState.cs @@ -356,27 +356,30 @@ namespace Acacia.Features.SyncState HashSet syncingNow = new HashSet(); // Check all syncing data - foreach (KeyValuePair contentEntry in details.Content) + if (details.Content != null) { - DeviceDetails.ContentData content = contentEntry.Value; - content.Key = contentEntry.Key; - - if (content.IsSyncing) + foreach (KeyValuePair contentEntry in details.Content) { - // If the current session is not syncing, this is a restart. Clear stat - if (!IsSyncing) + DeviceDetails.ContentData content = contentEntry.Value; + content.Key = contentEntry.Key; + + if (content.IsSyncing) { - _syncContent.Clear(); - debug.AppendLine("Starting new SyncSession"); + // If the current session is not syncing, this is a restart. Clear stat + 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)); } } diff --git a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/ZPush/ContactStringReplacer.cs b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/ZPush/ContactStringReplacer.cs index f0d0532..5436732 100644 --- a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/ZPush/ContactStringReplacer.cs +++ b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/ZPush/ContactStringReplacer.cs @@ -81,6 +81,9 @@ namespace Acacia.ZPush if (result != null && result != contact) result.Dispose(); + if (contact == null) + return null; + return new ContactStringReplacer(contact); }