diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-07-10 03:37:00 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-07-10 03:37:00 -0400 |
| commit | 07ab6a19e25b722513cf4731427ca04a08c6cb86 (patch) | |
| tree | 8a2c5c2bbdf5455aa304300baf6042b4c4d78bc5 /Emby.Common.Implementations/BaseApplicationHost.cs | |
| parent | 1c1aa7c2c56c42a3d23fff945b2bde444ed5d4a3 (diff) | |
3.2.24.1
Diffstat (limited to 'Emby.Common.Implementations/BaseApplicationHost.cs')
| -rw-r--r-- | Emby.Common.Implementations/BaseApplicationHost.cs | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/Emby.Common.Implementations/BaseApplicationHost.cs b/Emby.Common.Implementations/BaseApplicationHost.cs index d16afbce3..847eeca64 100644 --- a/Emby.Common.Implementations/BaseApplicationHost.cs +++ b/Emby.Common.Implementations/BaseApplicationHost.cs @@ -169,14 +169,15 @@ namespace Emby.Common.Implementations { _deviceId = new DeviceId(ApplicationPaths, LogManager.GetLogger("SystemId"), FileSystemManager); } - + return _deviceId.Value; } } public PackageVersionClass SystemUpdateLevel { - get { + get + { #if BETA return PackageVersionClass.Beta; @@ -216,7 +217,7 @@ namespace Emby.Common.Implementations // hack alert, until common can target .net core BaseExtensions.CryptographyProvider = CryptographyProvider; - + XmlSerializer = new MyXmlSerializer(fileSystem, logManager.GetLogger("XmlSerializer")); FailedAssemblies = new List<string>(); @@ -565,7 +566,10 @@ namespace Emby.Common.Implementations 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 +582,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>(); } } |
