diff options
| author | dkanada <dkanada@users.noreply.github.com> | 2021-09-06 13:42:48 +0900 |
|---|---|---|
| committer | dkanada <dkanada@users.noreply.github.com> | 2021-09-06 13:42:48 +0900 |
| commit | f6c0db4bb5007182d79ceb809675b90909fd1fa0 (patch) | |
| tree | ab13e60d0cba2477585a6d0ec601f10ad9f112b2 /Emby.Server.Implementations/AppBase/ConfigurationHelper.cs | |
| parent | 776ce7c660a6d6bf975766378d6db7124f4ac232 (diff) | |
| parent | e9508616cc90c01a22ca28c13694587dd16b49d6 (diff) | |
merge branch 'master' into syncplay-sessions-fix
Diffstat (limited to 'Emby.Server.Implementations/AppBase/ConfigurationHelper.cs')
| -rw-r--r-- | Emby.Server.Implementations/AppBase/ConfigurationHelper.cs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs b/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs index 3f7076383..0308a68e4 100644 --- a/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs +++ b/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs @@ -1,9 +1,6 @@ -#nullable enable - using System; using System.IO; using System.Linq; -using MediaBrowser.Common.Extensions; using MediaBrowser.Model.Serialization; namespace Emby.Server.Implementations.AppBase @@ -36,7 +33,8 @@ namespace Emby.Server.Implementations.AppBase } catch (Exception) { - configuration = Activator.CreateInstance(type) ?? throw new ArgumentException($"Provided path ({type}) is not valid.", nameof(type)); + // Note: CreateInstance returns null for Nullable<T>, e.g. CreateInstance(typeof(int?)) returns null. + configuration = Activator.CreateInstance(type)!; } using var stream = new MemoryStream(buffer?.Length ?? 0); |
