aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-07-10 05:08:46 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-07-10 05:08:46 -0400
commit975a973d316ee47f7ebb47a2a9f5e94806546dcc (patch)
tree9560c424a537e8c14b900cc7d73cfd6860281872
parentfe8b69406aa3192f971359ad20c8a87f69b9b91f (diff)
Improve error handling when attempting to load very old plugin assemblies
-rw-r--r--Emby.Common.Implementations/BaseApplicationHost.cs16
-rw-r--r--SharedVersion.cs2
2 files changed, 14 insertions, 4 deletions
diff --git a/Emby.Common.Implementations/BaseApplicationHost.cs b/Emby.Common.Implementations/BaseApplicationHost.cs
index d16afbce3..2f3b0ba4b 100644
--- a/Emby.Common.Implementations/BaseApplicationHost.cs
+++ b/Emby.Common.Implementations/BaseApplicationHost.cs
@@ -560,12 +560,15 @@ namespace Emby.Common.Implementations
{
if (assembly == null)
{
- throw new ArgumentNullException("assembly");
+ return new List<Type>();
}
try
{
- return assembly.GetTypes();
+ // This null checking really shouldn't be needed but adding it due to some
+ // unhandled exceptions in mono 5.0 that are a little hard to hunt down
+ var types = assembly.GetTypes() ?? new Type[] { };
+ return types.Where(t => t != null);
}
catch (ReflectionTypeLoadException ex)
{
@@ -578,7 +581,14 @@ namespace Emby.Common.Implementations
}
// If it fails we can still get a list of the Types it was able to resolve
- return ex.Types.Where(t => t != null);
+ var types = ex.Types ?? new Type[] { };
+ return types.Where(t => t != null);
+ }
+ catch (Exception ex)
+ {
+ Logger.ErrorException("Error loading types from assembly", ex);
+
+ return new List<Type>();
}
}
diff --git a/SharedVersion.cs b/SharedVersion.cs
index 1b7b9e921..c1fcd083e 100644
--- a/SharedVersion.cs
+++ b/SharedVersion.cs
@@ -1,3 +1,3 @@
using System.Reflection;
-[assembly: AssemblyVersion("3.2.24.0")]
+[assembly: AssemblyVersion("3.2.25.0")]