Use ArgumentException.ThrowIfNullOrEmpty

This commit is contained in:
Bond_009
2022-10-13 19:08:00 +02:00
parent 93fd462b58
commit b366dc2e6e
58 changed files with 130 additions and 549 deletions

View File

@@ -219,10 +219,7 @@ namespace Emby.Server.Implementations.Localization
/// <inheritdoc />
public int? GetRatingLevel(string rating)
{
if (string.IsNullOrEmpty(rating))
{
throw new ArgumentNullException(nameof(rating));
}
ArgumentException.ThrowIfNullOrEmpty(rating);
if (_unratedValues.Contains(rating.AsSpan(), StringComparison.OrdinalIgnoreCase))
{
@@ -295,10 +292,7 @@ namespace Emby.Server.Implementations.Localization
private Dictionary<string, string> GetLocalizationDictionary(string culture)
{
if (string.IsNullOrEmpty(culture))
{
throw new ArgumentNullException(nameof(culture));
}
ArgumentException.ThrowIfNullOrEmpty(culture);
const string Prefix = "Core";
@@ -310,10 +304,7 @@ namespace Emby.Server.Implementations.Localization
private async Task<Dictionary<string, string>> GetDictionary(string prefix, string culture, string baseFilename)
{
if (string.IsNullOrEmpty(culture))
{
throw new ArgumentNullException(nameof(culture));
}
ArgumentException.ThrowIfNullOrEmpty(culture);
var dictionary = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);