diff --git a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/ThisAddIn.cs b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/ThisAddIn.cs index e000b51..3278353 100644 --- a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/ThisAddIn.cs +++ b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/ThisAddIn.cs @@ -113,7 +113,8 @@ namespace Acacia // Create the watcher Watcher = new ZPushWatcher(Instance); - OutlookUI.Watcher = Watcher; + if (OutlookUI != null) + OutlookUI.Watcher = Watcher; // Allow to features to register whatever they need Features = new List(); @@ -155,9 +156,6 @@ namespace Acacia Acacia.Features.DebugSupport.Statistics.StartupTime.Stop(); foreach (Feature feature in Features) feature.AfterStartup(); - - // [KOE-148] Initial send receive - Instance.SendReceive(); } catch (System.Exception e) { diff --git a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/ZPush/ZPushAccounts.cs b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/ZPush/ZPushAccounts.cs index 3d5d9de..b3bd825 100644 --- a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/ZPush/ZPushAccounts.cs +++ b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/ZPush/ZPushAccounts.cs @@ -77,6 +77,9 @@ namespace Acacia.ZPush Tasks.Task(null, null, "AccountCheckDone", () => { _watcher.OnAccountsScanned(); + + // [KOE-148] Initial send receive + ThisAddIn.Instance.SendReceive(); }); // Register for account changes