aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Cryptography/PasswordHash.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Model/Cryptography/PasswordHash.cs')
-rw-r--r--MediaBrowser.Model/Cryptography/PasswordHash.cs10
1 files changed, 3 insertions, 7 deletions
diff --git a/MediaBrowser.Model/Cryptography/PasswordHash.cs b/MediaBrowser.Model/Cryptography/PasswordHash.cs
index 32a34d23c..ccb361c13 100644
--- a/MediaBrowser.Model/Cryptography/PasswordHash.cs
+++ b/MediaBrowser.Model/Cryptography/PasswordHash.cs
@@ -29,12 +29,7 @@ namespace MediaBrowser.Model.Cryptography
public PasswordHash(string id, byte[] hash, byte[] salt, Dictionary<string, string> parameters)
{
- ArgumentNullException.ThrowIfNull(id);
-
- if (id.Length == 0)
- {
- throw new ArgumentException("String can't be empty", nameof(id));
- }
+ ArgumentException.ThrowIfNullOrEmpty(id);
Id = id;
_hash = hash;
@@ -85,7 +80,8 @@ namespace MediaBrowser.Model.Cryptography
{
throw new FormatException("Hash string must contain a valid id");
}
- else if (nextSegment == -1)
+
+ if (nextSegment == -1)
{
return new PasswordHash(hashString.ToString(), Array.Empty<byte>());
}