0.8.0: Fixed issue, where a compiler error could result in a cascade of reflection exceptions from the toolbar

This commit is contained in:
Anders Ejlersen 2021-09-18 10:52:40 +02:00
parent ca34993eb3
commit 6fc88d3986
2 changed files with 21 additions and 12 deletions

View file

@ -133,11 +133,15 @@ namespace Module.NavigationTool.Editor.Toolbar
}
public static AbstractToolbarDrawer[] GetAllDrawers()
{
var list = new List<AbstractToolbarDrawer>(8);
try
{
Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
Type iType = typeof(AbstractToolbarDrawer);
var list = new List<AbstractToolbarDrawer>(8);
for (var i = 0; i < assemblies.Length; i++)
{
@ -152,6 +156,11 @@ namespace Module.NavigationTool.Editor.Toolbar
list.Add((AbstractToolbarDrawer)FormatterServices.GetUninitializedObject(type));
}
}
}
catch (Exception)
{
// Fail silently
}
return list.ToArray();
}

View file

@ -1,6 +1,6 @@
{
"name": "com.module.navigationtool",
"version": "0.7.2",
"version": "0.8.0",
"displayName": "Module.NavigationTool",
"description": "Support for navigation tools, like favorites, history and toolbars",
"unity": "2019.2",