aboutsummaryrefslogtreecommitdiff
path: root/Emby.Common.Implementations/BaseApplicationHost.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Common.Implementations/BaseApplicationHost.cs')
-rw-r--r--Emby.Common.Implementations/BaseApplicationHost.cs11
1 files changed, 7 insertions, 4 deletions
diff --git a/Emby.Common.Implementations/BaseApplicationHost.cs b/Emby.Common.Implementations/BaseApplicationHost.cs
index 7e0fd23b5..e7710162c 100644
--- a/Emby.Common.Implementations/BaseApplicationHost.cs
+++ b/Emby.Common.Implementations/BaseApplicationHost.cs
@@ -557,7 +557,7 @@ namespace Emby.Common.Implementations
/// <param name="assembly">The assembly.</param>
/// <returns>IEnumerable{Type}.</returns>
/// <exception cref="System.ArgumentNullException">assembly</exception>
- protected IEnumerable<Type> GetTypes(Assembly assembly)
+ protected List<Type> GetTypes(Assembly assembly)
{
if (assembly == null)
{
@@ -569,7 +569,7 @@ namespace Emby.Common.Implementations
// 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);
+ return types.Where(t => t != null).ToList();
}
catch (ReflectionTypeLoadException ex)
{
@@ -577,13 +577,16 @@ namespace Emby.Common.Implementations
{
foreach (var loaderException in ex.LoaderExceptions)
{
- Logger.Error("LoaderException: " + loaderException.Message);
+ if (loaderException != null)
+ {
+ Logger.Error("LoaderException: " + loaderException.Message);
+ }
}
}
// If it fails we can still get a list of the Types it was able to resolve
var types = ex.Types ?? new Type[] { };
- return types.Where(t => t != null);
+ return types.Where(t => t != null).ToList();
}
catch (Exception ex)
{