mirror of
https://github.com/bitwarden/server.git
synced 2025-06-19 18:38:03 -05:00
Use argumentNullException
This commit is contained in:
parent
354320a88c
commit
68960efc85
@ -18,7 +18,7 @@ public class PrivateKeysResponseModel : ResponseModel
|
||||
public PrivateKeysResponseModel(UserAccountKeysData accountKeys) : base("privateKeys")
|
||||
{
|
||||
PublicKeyEncryptionKeyPair = new PublicKeyEncryptionKeyPairModel(accountKeys.PublicKeyEncryptionKeyPairData);
|
||||
ArgumentNullException.ThrowIfNull(accountKeys);
|
||||
ArgumentNullException.ThrowIfNull(accountKeys);
|
||||
|
||||
if (accountKeys.SignatureKeyPairData != null)
|
||||
{
|
||||
|
@ -16,10 +16,7 @@ public class PublicKeysResponseModel : ResponseModel
|
||||
: base("publicKeys")
|
||||
{
|
||||
PublicKey = accountKeys.PublicKeyEncryptionKeyPairData.PublicKey;
|
||||
if (accountKeys == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(accountKeys));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(accountKeys);
|
||||
|
||||
if (accountKeys.SignatureKeyPairData != null)
|
||||
{
|
||||
|
@ -15,11 +15,7 @@ public class SignatureKeyPairResponseModel : ResponseModel
|
||||
public SignatureKeyPairResponseModel(SignatureKeyPairData signatureKeyPair)
|
||||
: base("signatureKeyPair")
|
||||
{
|
||||
if (signatureKeyPair == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(signatureKeyPair));
|
||||
}
|
||||
|
||||
ArgumentNullException.ThrowIfNull(signatureKeyPair);
|
||||
WrappedSigningKey = signatureKeyPair.WrappedSigningKey;
|
||||
VerifyingKey = signatureKeyPair.VerifyingKey;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user