Fix some warnings

This commit is contained in:
Bond_009
2021-05-28 14:33:54 +02:00
parent b12f509de3
commit 0bc0601442
27 changed files with 210 additions and 228 deletions

View File

@@ -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);