aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Cryptography
diff options
context:
space:
mode:
authorcrobibero <cody@robibe.ro>2020-11-13 11:24:46 -0700
committercrobibero <cody@robibe.ro>2020-11-13 11:24:46 -0700
commit95ebb9a55ace6c544fa7fa15d0a255a5cee752a8 (patch)
treef5ce2c6ea994d63712d45772ad712ac6bcf79ab6 /Emby.Server.Implementations/Cryptography
parent5f52a58e785fa4ae06fa07a93b81c1e7547ac9f3 (diff)
Use null coalescing when possible
Diffstat (limited to 'Emby.Server.Implementations/Cryptography')
-rw-r--r--Emby.Server.Implementations/Cryptography/CryptographyProvider.cs7
1 files changed, 1 insertions, 6 deletions
diff --git a/Emby.Server.Implementations/Cryptography/CryptographyProvider.cs b/Emby.Server.Implementations/Cryptography/CryptographyProvider.cs
index 8d7f73b3c..42db18396 100644
--- a/Emby.Server.Implementations/Cryptography/CryptographyProvider.cs
+++ b/Emby.Server.Implementations/Cryptography/CryptographyProvider.cs
@@ -81,12 +81,7 @@ namespace Emby.Server.Implementations.Cryptography
throw new CryptographicException($"Requested hash method is not supported: {hashMethod}");
}
- using var h = HashAlgorithm.Create(hashMethod);
- if (h == null)
- {
- throw new ResourceNotFoundException(nameof(h));
- }
-
+ using var h = HashAlgorithm.Create(hashMethod) ?? throw new ResourceNotFoundException(nameof(hashMethod));
if (salt.Length == 0)
{
return h.ComputeHash(bytes);