diff options
| author | Bond-009 <bond.009@outlook.com> | 2021-05-30 10:11:05 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-30 10:11:05 +0200 |
| commit | 9712fa85c4651ccb0fc2b0e206dac8d17295a016 (patch) | |
| tree | 6cadaf9b0d3259778f5f013dc2c2e3620eff13eb /Emby.Server.Implementations/AppBase/ConfigurationHelper.cs | |
| parent | 71c98d2f81f8f1091f996d9150cf732224f798d4 (diff) | |
| parent | 0bc06014427e36a770adeda66392d08147658ea8 (diff) | |
Merge pull request #6121 from Bond-009/warn52
Fix some warnings
Diffstat (limited to 'Emby.Server.Implementations/AppBase/ConfigurationHelper.cs')
| -rw-r--r-- | Emby.Server.Implementations/AppBase/ConfigurationHelper.cs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs b/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs index de770f59e..0308a68e4 100644 --- a/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs +++ b/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs @@ -33,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); |
