mirror of
https://github.com/Kopano-dev/kopano-ol-extension.git
synced 2023-10-10 13:37:40 +02:00
Exception while loading shared folder tree nodes is now logged. Any nodes whose parents are missing are silently ignored.
This commit is contained in:
parent
e9ec0cd855
commit
5daff1dc44
@ -107,6 +107,7 @@ namespace Acacia.Controls
|
|||||||
}, true)
|
}, true)
|
||||||
.OnError(error =>
|
.OnError(error =>
|
||||||
{
|
{
|
||||||
|
Logger.Instance.Error(this, "Exception while fetching child nodes: {0}", error);
|
||||||
// On error return an empty node list
|
// On error return an empty node list
|
||||||
State = LoadingState.Error;
|
State = LoadingState.Error;
|
||||||
return new KTreeNodes(node);
|
return new KTreeNodes(node);
|
||||||
|
@ -96,10 +96,13 @@ namespace Acacia.ZPush.API.SharedFolders
|
|||||||
rootNodes.Add(folder);
|
rootNodes.Add(folder);
|
||||||
parent = null;
|
parent = null;
|
||||||
}
|
}
|
||||||
|
else if (!foldersByServerId.ContainsKey(folder.ParentId))
|
||||||
|
{
|
||||||
|
// Ignore the node if the parent is not available
|
||||||
|
continue;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!foldersByServerId.ContainsKey(folder.ParentId))
|
|
||||||
throw new Exception("Missing parent folder: " + folder.ParentId);
|
|
||||||
parent = foldersByServerId[folder.ParentId];
|
parent = foldersByServerId[folder.ParentId];
|
||||||
parent.Children.Add(folder);
|
parent.Children.Add(folder);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user