mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-16 15:24:10 +01:00
Use ArgumentException.ThrowIfNullOrEmpty
This commit is contained in:
@@ -140,10 +140,7 @@ namespace Emby.Server.Implementations.Data
|
||||
throw new ArgumentNullException(nameof(userId));
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(key))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(key));
|
||||
}
|
||||
ArgumentException.ThrowIfNullOrEmpty(key);
|
||||
|
||||
PersistUserData(userId, key, userData, cancellationToken);
|
||||
}
|
||||
@@ -274,10 +271,7 @@ namespace Emby.Server.Implementations.Data
|
||||
throw new ArgumentNullException(nameof(userId));
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(key))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(key));
|
||||
}
|
||||
ArgumentException.ThrowIfNullOrEmpty(key);
|
||||
|
||||
using (var connection = GetConnection(true))
|
||||
{
|
||||
|
||||
@@ -23,10 +23,7 @@ namespace Emby.Server.Implementations.Data
|
||||
/// <exception cref="ArgumentNullException"><c>typeName</c> is null.</exception>
|
||||
public Type? GetType(string typeName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(typeName))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(typeName));
|
||||
}
|
||||
ArgumentException.ThrowIfNullOrEmpty(typeName);
|
||||
|
||||
return _typeMap.GetOrAdd(typeName, k => AppDomain.CurrentDomain.GetAssemblies()
|
||||
.Select(a => a.GetType(k))
|
||||
|
||||
Reference in New Issue
Block a user