mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-15 20:20:25 +01:00
Merge pull request #8503 from Bond-009/ThrowIfNull
This commit is contained in:
@@ -29,10 +29,7 @@ namespace MediaBrowser.Model.Cryptography
|
||||
|
||||
public PasswordHash(string id, byte[] hash, byte[] salt, Dictionary<string, string> parameters)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(id));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(id);
|
||||
|
||||
if (id.Length == 0)
|
||||
{
|
||||
|
||||
@@ -565,10 +565,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
private StreamInfo BuildVideoItem(MediaSourceInfo item, VideoOptions options)
|
||||
{
|
||||
if (item == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(item));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(item);
|
||||
|
||||
StreamInfo playlistItem = new StreamInfo
|
||||
{
|
||||
|
||||
@@ -28,10 +28,7 @@ namespace MediaBrowser.Model.Entities
|
||||
/// <returns><c>true</c> if a provider id with the given name was found; otherwise <c>false</c>.</returns>
|
||||
public static bool HasProviderId(this IHasProviderIds instance, string name)
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(instance));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(instance);
|
||||
|
||||
return instance.TryGetProviderId(name, out _);
|
||||
}
|
||||
@@ -56,10 +53,7 @@ namespace MediaBrowser.Model.Entities
|
||||
/// <returns><c>true</c> if a provider id with the given name was found; otherwise <c>false</c>.</returns>
|
||||
public static bool TryGetProviderId(this IHasProviderIds instance, string name, [NotNullWhen(true)] out string? id)
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(instance));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(instance);
|
||||
|
||||
if (instance.ProviderIds == null)
|
||||
{
|
||||
@@ -121,10 +115,7 @@ namespace MediaBrowser.Model.Entities
|
||||
/// <param name="value">The value.</param>
|
||||
public static void SetProviderId(this IHasProviderIds instance, string name, string? value)
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(instance));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(instance);
|
||||
|
||||
// If it's null remove the key from the dictionary
|
||||
if (string.IsNullOrEmpty(value))
|
||||
|
||||
Reference in New Issue
Block a user