mirror of
https://github.com/Kopano-dev/kopano-ol-extension.git
synced 2023-10-10 11:37:40 +00:00
[KOE-133] Added checks for null accounts and explorers, which happens when an email is sent through another application.
This commit is contained in:
parent
18eb719721
commit
d00fcffcf8
@ -251,7 +251,10 @@ namespace Acacia.Stubs.OutlookWrappers
|
|||||||
|
|
||||||
public IExplorer GetActiveExplorer()
|
public IExplorer GetActiveExplorer()
|
||||||
{
|
{
|
||||||
return new ExplorerWrapper(_app.ActiveExplorer());
|
NSOutlook.Explorer explorer = _app.ActiveExplorer();
|
||||||
|
if (explorer == null)
|
||||||
|
return null;
|
||||||
|
return new ExplorerWrapper(explorer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IInspectors GetInspectors()
|
public IInspectors GetInspectors()
|
||||||
|
@ -74,6 +74,8 @@ namespace Acacia.ZPush
|
|||||||
// TODO: cache folder id per store
|
// TODO: cache folder id per store
|
||||||
using (IStore store = folder.GetStore())
|
using (IStore store = folder.GetStore())
|
||||||
{
|
{
|
||||||
|
if (store == null)
|
||||||
|
return false;
|
||||||
return folder.EntryID == store.GetDefaultFolderId(_folder);
|
return folder.EntryID == store.GetDefaultFolderId(_folder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -137,6 +137,8 @@ namespace Acacia.ZPush
|
|||||||
|
|
||||||
public ZPushAccount GetAccount(IStore store)
|
public ZPushAccount GetAccount(IStore store)
|
||||||
{
|
{
|
||||||
|
if (store == null)
|
||||||
|
return null;
|
||||||
ZPushAccount value = null;
|
ZPushAccount value = null;
|
||||||
_accountsByStoreId.TryGetValue(store.StoreID, out value);
|
_accountsByStoreId.TryGetValue(store.StoreID, out value);
|
||||||
return value;
|
return value;
|
||||||
|
@ -52,15 +52,17 @@ namespace Acacia.ZPush
|
|||||||
Accounts = new ZPushAccounts(this, addIn);
|
Accounts = new ZPushAccounts(this, addIn);
|
||||||
|
|
||||||
// Need to keep a link to keep receiving events
|
// Need to keep a link to keep receiving events
|
||||||
|
// Might be null when starting a compose window only
|
||||||
_explorer = _addIn.GetActiveExplorer();
|
_explorer = _addIn.GetActiveExplorer();
|
||||||
_explorer.SelectionChange += Explorer_SelectionChange;
|
if (_explorer != null)
|
||||||
|
_explorer.SelectionChange += Explorer_SelectionChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void DoRelease()
|
protected override void DoRelease()
|
||||||
{
|
{
|
||||||
Accounts.Dispose();
|
Accounts.Dispose();
|
||||||
Sync.Dispose();
|
Sync.Dispose();
|
||||||
_explorer.Dispose();
|
_explorer?.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user